aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bttv-i2c.c
diff options
context:
space:
mode:
authorGerd Knorr <kraxel@suse.de>2005-05-25 15:31:26 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-25 18:31:27 -0400
commit5daf05fbf73fc199e7a93a818e504856d07c5586 (patch)
tree8e4eeb3012164f9aea42b7880460299bf7a09880 /drivers/media/video/bttv-i2c.c
parent1b981021e88c8c28dc6a22cb1a327d8dc9296473 (diff)
[PATCH] v4l: bttv i2c oops fix
Don't try to access the i2c bus if the register wasn't successful. Signed-off-by: Gerd Knorr <kraxel@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/bttv-i2c.c')
-rw-r--r--drivers/media/video/bttv-i2c.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c
index e3f477dff827..c2368bc832ed 100644
--- a/drivers/media/video/bttv-i2c.c
+++ b/drivers/media/video/bttv-i2c.c
@@ -363,6 +363,9 @@ int bttv_I2CWrite(struct bttv *btv, unsigned char addr, unsigned char b1,
363/* read EEPROM content */ 363/* read EEPROM content */
364void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr) 364void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr)
365{ 365{
366 memset(eedata, 0, 256);
367 if (0 != btv->i2c_rc)
368 return;
366 btv->i2c_client.addr = addr >> 1; 369 btv->i2c_client.addr = addr >> 1;
367 tveeprom_read(&btv->i2c_client, eedata, 256); 370 tveeprom_read(&btv->i2c_client, eedata, 256);
368} 371}