[media] dvb: return the error from i2c_transfer if negative
authorHans Wennborg <hans@hanshq.net>
Thu, 7 Aug 2014 05:42:04 +0000 (02:42 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 22 Sep 2014 20:05:13 +0000 (17:05 -0300)
Just returns whatever error that was returned by the i2c core,
in the case of errors, only returning -EREMOTEIO if the transfer size
is not what it was expected.

Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/mb86a16.c

index bc9a0adda3cbd2cc022726c3efe4b1f710f68f68..3ddea4471d2b6668f633a963115d02cdad067f24 100644 (file)
@@ -118,6 +118,8 @@ static int mb86a16_read(struct mb86a16_state *state, u8 reg, u8 *val)
                dprintk(verbose, MB86A16_ERROR, 1, "read error(reg=0x%02x, ret=%i)",
                        reg, ret);
 
+               if (ret < 0)
+                       return ret;
                return -EREMOTEIO;
        }
        *val = b1[0];