diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-16 00:44:14 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-16 00:44:14 -0200 |
commit | 24f47584d5c7fed9035c336c8201dff77a701227 (patch) | |
tree | dc9483c99b9d2dc48e45e19a98c20549162fabbc /linux | |
parent | e4997e2899e1870f5ee53e72a72d49f09ef47a7e (diff) | |
download | mediapointer-dvb-s2-24f47584d5c7fed9035c336c8201dff77a701227.tar.gz mediapointer-dvb-s2-24f47584d5c7fed9035c336c8201dff77a701227.tar.bz2 |
em28xx: Avoid i2c register error for boards without eeprom
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-i2c.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-i2c.c b/linux/drivers/media/video/em28xx/em28xx-i2c.c index 51ecdcd34..ec3e3b157 100644 --- a/linux/drivers/media/video/em28xx/em28xx-i2c.c +++ b/linux/drivers/media/video/em28xx/em28xx-i2c.c @@ -348,9 +348,9 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len) /* Check if board has eeprom */ err = i2c_master_recv(&dev->i2c_client, &buf, 0); if (err < 0) { - em28xx_errdev("%s: i2c_master_recv failed! err [%d]\n", - __func__, err); - return err; + em28xx_errdev("board has no eeprom\n"); + memset(eedata, 0, len); + return -ENODEV; } buf = 0; @@ -620,14 +620,16 @@ int em28xx_i2c_register(struct em28xx *dev) dev->i2c_client.adapter = &dev->i2c_adap; retval = em28xx_i2c_eeprom(dev, dev->eedata, sizeof(dev->eedata)); - if (retval < 0) { + if ((retval < 0) && (retval != -ENODEV)) { em28xx_errdev("%s: em28xx_i2_eeprom failed! retval [%d]\n", __func__, retval); + return retval; } if (i2c_scan) em28xx_do_i2c_scan(dev); + return 0; } |