diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2012-10-02 10:04:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-02 14:17:46 -0400 |
commit | 351d18786e1fa45d1cd20bad03e445dbb50e0912 (patch) | |
tree | 34596aefad02702460df4271edebe73eee79bc94 | |
parent | 6b82e0cfc15ec7e635eea83b04e1544ab64f81ad (diff) |
[media] tda18271: properly report read errors in tda18271_get_id
Until now, if there is a read error in tda18271_get_id, the driver
reports "Unknown device..." Instead, check the return value of
tda18271_read_regs and display the appropriate error message.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/tuners/tda18271-fe.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/tuners/tda18271-fe.c b/drivers/media/tuners/tda18271-fe.c index ca202da9d4c9..72c26fd77922 100644 --- a/drivers/media/tuners/tda18271-fe.c +++ b/drivers/media/tuners/tda18271-fe.c | |||
@@ -1159,11 +1159,19 @@ static int tda18271_get_id(struct dvb_frontend *fe) | |||
1159 | struct tda18271_priv *priv = fe->tuner_priv; | 1159 | struct tda18271_priv *priv = fe->tuner_priv; |
1160 | unsigned char *regs = priv->tda18271_regs; | 1160 | unsigned char *regs = priv->tda18271_regs; |
1161 | char *name; | 1161 | char *name; |
1162 | int ret; | ||
1162 | 1163 | ||
1163 | mutex_lock(&priv->lock); | 1164 | mutex_lock(&priv->lock); |
1164 | tda18271_read_regs(fe); | 1165 | ret = tda18271_read_regs(fe); |
1165 | mutex_unlock(&priv->lock); | 1166 | mutex_unlock(&priv->lock); |
1166 | 1167 | ||
1168 | if (ret) { | ||
1169 | tda_info("Error reading device ID @ %d-%04x, bailing out.\n", | ||
1170 | i2c_adapter_id(priv->i2c_props.adap), | ||
1171 | priv->i2c_props.addr); | ||
1172 | return -EIO; | ||
1173 | } | ||
1174 | |||
1167 | switch (regs[R_ID] & 0x7f) { | 1175 | switch (regs[R_ID] & 0x7f) { |
1168 | case 3: | 1176 | case 3: |
1169 | name = "TDA18271HD/C1"; | 1177 | name = "TDA18271HD/C1"; |