local_irq_disable(); 
i2c_readreg(unsigned char theSlave, unsigned char theReg){	unsigned char b = 0;	int error, cntr = 3;	unsigned long flags;	do {		error = 0;		/*		 * we don't like to be interrupted		 */		local_irq_save(flags);		local_irq_disable();		/*		 * generate start condition		 */		i2c_start();    		/*		 * send slave address		 */		i2c_outbyte((theSlave & 0xfe));		/*		 * wait for ack		 */		if(!i2c_getack())			error = 1;		/*		 * now select register		 */		i2c_dir_out();		i2c_outbyte(theReg);		/*		 * now it's time to wait for ack		 */		if(!i2c_getack())			error = 1;		/*		 * repeat start condition		 */		i2c_delay(CLOCK_LOW_TIME);		i2c_start();		/*		 * send slave address		 */		i2c_outbyte(theSlave | 0x01);		/*		 * wait for ack		 */		if(!i2c_getack())			error = 1;		/*		 * fetch register		 */		b = i2c_inbyte();		/*		 * last received byte needs to be nacked		 * instead of acked		 */		i2c_sendack();		/*		 * end sequence		 */		i2c_stop();		/*		 * enable interrupt again		 */		local_irq_restore(flags);			} while(error && cntr--);	return b;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7e9204265b4ec6680fad9abc7a78b94087983916/i2c.c/buggy/arch/cris/arch-v10/drivers/i2c.c