Commit 5daf05fb authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: bttv i2c oops fix

Don't try to access the i2c bus if the register wasn't successful.
Signed-off-by: default avatarGerd Knorr <kraxel@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1b981021
...@@ -363,6 +363,9 @@ int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1, ...@@ -363,6 +363,9 @@ int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1,
/* read EEPROM content */ /* read EEPROM content */
void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr) 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; btv->i2c_client.addr = addr >> 1;
tveeprom_read(&btv->i2c_client, eedata, 256); tveeprom_read(&btv->i2c_client, eedata, 256);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment