Commit c41109fc authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (9627): em28xx: Avoid i2c register error for boards without eeprom

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent df4533af
...@@ -337,9 +337,9 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len) ...@@ -337,9 +337,9 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len)
/* Check if board has eeprom */ /* Check if board has eeprom */
err = i2c_master_recv(&dev->i2c_client, &buf, 0); err = i2c_master_recv(&dev->i2c_client, &buf, 0);
if (err < 0) { if (err < 0) {
em28xx_errdev("%s: i2c_master_recv failed! err [%d]\n", em28xx_errdev("board has no eeprom\n");
__func__, err); memset(eedata, 0, len);
return err; return -ENODEV;
} }
buf = 0; buf = 0;
...@@ -609,14 +609,16 @@ int em28xx_i2c_register(struct em28xx *dev) ...@@ -609,14 +609,16 @@ int em28xx_i2c_register(struct em28xx *dev)
dev->i2c_client.adapter = &dev->i2c_adap; dev->i2c_client.adapter = &dev->i2c_adap;
retval = em28xx_i2c_eeprom(dev, dev->eedata, sizeof(dev->eedata)); 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", em28xx_errdev("%s: em28xx_i2_eeprom failed! retval [%d]\n",
__func__, retval); __func__, retval);
return retval; return retval;
} }
if (i2c_scan) if (i2c_scan)
em28xx_do_i2c_scan(dev); em28xx_do_i2c_scan(dev);
return 0; return 0;
} }
......
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