Commit 31940e39 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (7841): tda18271: fix error handling in tda18271_channel_configuration

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 9c41d456
...@@ -51,6 +51,7 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, ...@@ -51,6 +51,7 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
{ {
struct tda18271_priv *priv = fe->tuner_priv; struct tda18271_priv *priv = fe->tuner_priv;
unsigned char *regs = priv->tda18271_regs; unsigned char *regs = priv->tda18271_regs;
int ret;
u32 N; u32 N;
/* update TV broadcast parameters */ /* update TV broadcast parameters */
...@@ -85,7 +86,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, ...@@ -85,7 +86,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
/* update rf top / if top */ /* update rf top / if top */
regs[R_EB22] = 0x00; regs[R_EB22] = 0x00;
regs[R_EB22] |= map->rfagc_top; regs[R_EB22] |= map->rfagc_top;
tda18271_write_regs(fe, R_EB22, 1); ret = tda18271_write_regs(fe, R_EB22, 1);
if (ret < 0)
goto fail;
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */
...@@ -121,7 +124,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, ...@@ -121,7 +124,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
/* agc1 has priority on agc2 */ /* agc1 has priority on agc2 */
regs[R_EB1] &= ~0x01; regs[R_EB1] &= ~0x01;
tda18271_write_regs(fe, R_EB1, 1); ret = tda18271_write_regs(fe, R_EB1, 1);
if (ret < 0)
goto fail;
/* --------------------------------------------------------------- */ /* --------------------------------------------------------------- */
...@@ -141,7 +146,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, ...@@ -141,7 +146,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
break; break;
} }
tda18271_write_regs(fe, R_TM, 7); ret = tda18271_write_regs(fe, R_TM, 7);
if (ret < 0)
goto fail;
/* force charge pump source */ /* force charge pump source */
charge_pump_source(fe, 1); charge_pump_source(fe, 1);
...@@ -158,9 +165,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, ...@@ -158,9 +165,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
regs[R_EP3] &= ~0x04; regs[R_EP3] &= ~0x04;
else else
regs[R_EP3] |= 0x04; regs[R_EP3] |= 0x04;
tda18271_write_regs(fe, R_EP3, 1); ret = tda18271_write_regs(fe, R_EP3, 1);
fail:
return 0; return ret;
} }
static int tda18271_read_thermometer(struct dvb_frontend *fe) static int tda18271_read_thermometer(struct dvb_frontend *fe)
...@@ -813,7 +820,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -813,7 +820,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
tda18271c2_rf_tracking_filters_correction(fe, freq); tda18271c2_rf_tracking_filters_correction(fe, freq);
break; break;
} }
tda18271_channel_configuration(fe, map, freq, bw); ret = tda18271_channel_configuration(fe, map, freq, bw);
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
fail: fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment