Skip to content

Commit

Permalink
[media] tda18271: properly report read errors in tda18271_get_id
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Oct 2, 2012
1 parent 6b82e0c commit 351d187
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/media/tuners/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 351d187

Please sign in to comment.