From: Olli Salonen Date: Tue, 5 May 2015 16:54:16 +0000 (-0300) Subject: [media] si2168: add I2C error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7adf99d20ce0e96a70755f452e3a63824b14060f;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [media] si2168: add I2C error handling Return error from si2168_cmd_execute in case the demodulator returns an error. Signed-off-by: Olli Salonen Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- 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;