aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2012-10-02 14:04:36 (GMT)
committerMichael Krufky <mkrufky@linuxtv.org>2012-10-02 14:04:36 (GMT)
commitccf5a7e347bf800025db0cf391c138c130720760 (patch)
tree606a3e4ad886a5ef26ff023a96a63ef64d96ec21
parent0458de67971ca06dfcb99c396203d2ef756d1a70 (diff)
tda18271: properly report read errors in tda18271_get_idtda18271-newtda18271
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>
-rw-r--r--drivers/media/tuners/tda18271-fe.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/tuners/tda18271-fe.c b/drivers/media/tuners/tda18271-fe.c
index ca202da..72c26fd 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";

Privacy Policy