Skip to content

Commit

Permalink
V4L/DVB (9627): em28xx: Avoid i2c register error for boards without e…
Browse files Browse the repository at this point in the history
…eprom

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Nov 17, 2008
1 parent df4533a commit c41109f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/media/video/em28xx/em28xx-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,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;
Expand Down Expand Up @@ -609,14 +609,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;
}

Expand Down

0 comments on commit c41109f

Please sign in to comment.