diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2012-10-02 11:04:36 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-02 15:17:46 -0300 |
commit | 351d18786e1fa45d1cd20bad03e445dbb50e0912 (patch) | |
tree | 34596aefad02702460df4271edebe73eee79bc94 /drivers/media/tuners/tda18271-fe.c | |
parent | 6b82e0cfc15ec7e635eea83b04e1544ab64f81ad (diff) | |
download | blackbird-op-linux-351d18786e1fa45d1cd20bad03e445dbb50e0912.tar.gz blackbird-op-linux-351d18786e1fa45d1cd20bad03e445dbb50e0912.zip |
[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>
Diffstat (limited to 'drivers/media/tuners/tda18271-fe.c')
-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) struct tda18271_priv *priv = fe->tuner_priv; unsigned char *regs = priv->tda18271_regs; char *name; + int ret; mutex_lock(&priv->lock); - tda18271_read_regs(fe); + ret = tda18271_read_regs(fe); mutex_unlock(&priv->lock); + if (ret) { + tda_info("Error reading device ID @ %d-%04x, bailing out.\n", + i2c_adapter_id(priv->i2c_props.adap), + priv->i2c_props.addr); + return -EIO; + } + switch (regs[R_ID] & 0x7f) { case 3: name = "TDA18271HD/C1"; |