Commit 1f97947c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] cx231xx: handle errors at read_eeprom()

Fix the following warnings:
	drivers/media/usb/cx231xx/cx231xx-cards.c: In function 'read_eeprom':
	drivers/media/usb/cx231xx/cx231xx-cards.c:979:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 140a7987
...@@ -991,13 +991,20 @@ static int read_eeprom(struct cx231xx *dev, u8 *eedata, int len) ...@@ -991,13 +991,20 @@ static int read_eeprom(struct cx231xx *dev, u8 *eedata, int len)
/* start reading at offset 0 */ /* start reading at offset 0 */
ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_write, 1); ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_write, 1);
if (ret < 0) {
cx231xx_err("Can't read eeprom\n");
return ret;
}
while (len_todo > 0) { while (len_todo > 0) {
msg_read.len = (len_todo > 64) ? 64 : len_todo; msg_read.len = (len_todo > 64) ? 64 : len_todo;
msg_read.buf = eedata_cur; msg_read.buf = eedata_cur;
ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_read, 1); ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_read, 1);
if (ret < 0) {
cx231xx_err("Can't read eeprom\n");
return ret;
}
eedata_cur += msg_read.len; eedata_cur += msg_read.len;
len_todo -= msg_read.len; len_todo -= msg_read.len;
} }
......
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