diff options
author | Olli Salonen <olli.salonen@iki.fi> | 2015-05-05 13:54:16 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-05-12 13:19:26 -0300 |
commit | 7adf99d20ce0e96a70755f452e3a63824b14060f (patch) | |
tree | 3039e7b61fb43302e8f27f1b12f1bb17e8f8aee2 /drivers/media/dvb-frontends/si2168.c | |
parent | c060f9329f4a5aa94d8e61c8f2bb8996a8180059 (diff) | |
download | linux-7adf99d20ce0e96a70755f452e3a63824b14060f.tar.gz linux-7adf99d20ce0e96a70755f452e3a63824b14060f.tar.bz2 linux-7adf99d20ce0e96a70755f452e3a63824b14060f.zip |
[media] si2168: add I2C error handling
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>
Diffstat (limited to 'drivers/media/dvb-frontends/si2168.c')
-rw-r--r-- | drivers/media/dvb-frontends/si2168.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index 29a59369ea7b..b68ab346b93b 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c @@ -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; |