[media] si2168: add I2C error handling
authorOlli Salonen <olli.salonen@iki.fi>
Tue, 5 May 2015 16:54:16 +0000 (13:54 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 12 May 2015 16:19:26 +0000 (13:19 -0300)
Return error from si2168_cmd_execute in case the demodulator returns an
error.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/si2168.c

index 29a5936..b68ab34 100644 (file)
@@ -60,6 +60,12 @@ static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd)
                                jiffies_to_msecs(jiffies) -
                                (jiffies_to_msecs(timeout) - TIMEOUT));
 
+               /* error bit set? */
+               if ((cmd->args[0] >> 6) & 0x01) {
+                       ret = -EREMOTEIO;
+                       goto err_mutex_unlock;
+               }
+
                if (!((cmd->args[0] >> 7) & 0x01)) {
                        ret = -ETIMEDOUT;
                        goto err_mutex_unlock;