diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-27 15:27:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-27 16:03:51 -0400 |
commit | 1f97947c15a8d2bc21917463eb72d7f8685e3a86 (patch) | |
tree | cc073f9449de9b9b5a362c27f836310278f6a1fd /drivers/media | |
parent | 140a7987dbe4c5bbb6bb623373216ee6122fe8bf (diff) |
[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: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-cards.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c index 5812c63e1e4b..8039b769f258 100644 --- a/drivers/media/usb/cx231xx/cx231xx-cards.c +++ b/drivers/media/usb/cx231xx/cx231xx-cards.c | |||
@@ -991,13 +991,20 @@ static int read_eeprom(struct cx231xx *dev, u8 *eedata, int len) | |||
991 | 991 | ||
992 | /* start reading at offset 0 */ | 992 | /* start reading at offset 0 */ |
993 | ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_write, 1); | 993 | ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_write, 1); |
994 | if (ret < 0) { | ||
995 | cx231xx_err("Can't read eeprom\n"); | ||
996 | return ret; | ||
997 | } | ||
994 | 998 | ||
995 | while (len_todo > 0) { | 999 | while (len_todo > 0) { |
996 | msg_read.len = (len_todo > 64) ? 64 : len_todo; | 1000 | msg_read.len = (len_todo > 64) ? 64 : len_todo; |
997 | msg_read.buf = eedata_cur; | 1001 | msg_read.buf = eedata_cur; |
998 | 1002 | ||
999 | ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_read, 1); | 1003 | ret = i2c_transfer(&dev->i2c_bus[1].i2c_adap, &msg_read, 1); |
1000 | 1004 | if (ret < 0) { | |
1005 | cx231xx_err("Can't read eeprom\n"); | ||
1006 | return ret; | ||
1007 | } | ||
1001 | eedata_cur += msg_read.len; | 1008 | eedata_cur += msg_read.len; |
1002 | len_todo -= msg_read.len; | 1009 | len_todo -= msg_read.len; |
1003 | } | 1010 | } |