Skip to contentSkip to conversation

v4l: bttv i2c oops fix

PATCH New Gerd Knorr 1 participant 1 message May 24, 2005 Media (V4L/DVB)

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

PATCH 1/1 v4l: bttv i2c oops fix

Don't try to access the i2c bus if the register wasn't successful.

---
 drivers/media/video/bttv-i2c.c |    3 +++
 1 files changed, 3 insertions(+)
drivers/media/video/bttv-i2c.c +3 -0
Index: linux-2.6.12-rc3/drivers/media/video/bttv-i2c.c
===================================================================
@@ -365,6 +365,9 @@ int bttv_I2CWrite(struct bttv *btv, unsi
 /* read EEPROM content */
 void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr)
 {
+	memset(eedata, 0, 256);
+	if (0 != btv->i2c_rc)
+		return;
 	btv->i2c_client.addr = addr >> 1;
 	tveeprom_read(&btv->i2c_client, eedata, 256);
 }
Signature · 2 lines
-mm seems unusually stable at present.
	-- akpm about 2.6.12-rc3-mm3