diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-05-04 18:37:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-14 01:54:05 -0400 |
commit | 31940e3966b6cf3bb3e535ffa1cb97b16edd555b (patch) | |
tree | d36788ef6e12674a7188e0d5ddf7a5a9c0030816 /drivers | |
parent | 9c41d456e2936ea3aafa07d431c5963799f9659e (diff) |
V4L/DVB (7841): tda18271: fix error handling in tda18271_channel_configuration
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/common/tuners/tda18271-fe.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c index 3f7ca45bba9b..2c1bb380112d 100644 --- a/drivers/media/common/tuners/tda18271-fe.c +++ b/drivers/media/common/tuners/tda18271-fe.c | |||
@@ -51,6 +51,7 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, | |||
51 | { | 51 | { |
52 | struct tda18271_priv *priv = fe->tuner_priv; | 52 | struct tda18271_priv *priv = fe->tuner_priv; |
53 | unsigned char *regs = priv->tda18271_regs; | 53 | unsigned char *regs = priv->tda18271_regs; |
54 | int ret; | ||
54 | u32 N; | 55 | u32 N; |
55 | 56 | ||
56 | /* update TV broadcast parameters */ | 57 | /* update TV broadcast parameters */ |
@@ -85,7 +86,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, | |||
85 | /* update rf top / if top */ | 86 | /* update rf top / if top */ |
86 | regs[R_EB22] = 0x00; | 87 | regs[R_EB22] = 0x00; |
87 | regs[R_EB22] |= map->rfagc_top; | 88 | regs[R_EB22] |= map->rfagc_top; |
88 | tda18271_write_regs(fe, R_EB22, 1); | 89 | ret = tda18271_write_regs(fe, R_EB22, 1); |
90 | if (ret < 0) | ||
91 | goto fail; | ||
89 | 92 | ||
90 | /* --------------------------------------------------------------- */ | 93 | /* --------------------------------------------------------------- */ |
91 | 94 | ||
@@ -121,7 +124,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, | |||
121 | /* agc1 has priority on agc2 */ | 124 | /* agc1 has priority on agc2 */ |
122 | regs[R_EB1] &= ~0x01; | 125 | regs[R_EB1] &= ~0x01; |
123 | 126 | ||
124 | tda18271_write_regs(fe, R_EB1, 1); | 127 | ret = tda18271_write_regs(fe, R_EB1, 1); |
128 | if (ret < 0) | ||
129 | goto fail; | ||
125 | 130 | ||
126 | /* --------------------------------------------------------------- */ | 131 | /* --------------------------------------------------------------- */ |
127 | 132 | ||
@@ -141,7 +146,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, | |||
141 | break; | 146 | break; |
142 | } | 147 | } |
143 | 148 | ||
144 | tda18271_write_regs(fe, R_TM, 7); | 149 | ret = tda18271_write_regs(fe, R_TM, 7); |
150 | if (ret < 0) | ||
151 | goto fail; | ||
145 | 152 | ||
146 | /* force charge pump source */ | 153 | /* force charge pump source */ |
147 | charge_pump_source(fe, 1); | 154 | charge_pump_source(fe, 1); |
@@ -158,9 +165,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe, | |||
158 | regs[R_EP3] &= ~0x04; | 165 | regs[R_EP3] &= ~0x04; |
159 | else | 166 | else |
160 | regs[R_EP3] |= 0x04; | 167 | regs[R_EP3] |= 0x04; |
161 | tda18271_write_regs(fe, R_EP3, 1); | 168 | ret = tda18271_write_regs(fe, R_EP3, 1); |
162 | 169 | fail: | |
163 | return 0; | 170 | return ret; |
164 | } | 171 | } |
165 | 172 | ||
166 | static int tda18271_read_thermometer(struct dvb_frontend *fe) | 173 | static int tda18271_read_thermometer(struct dvb_frontend *fe) |
@@ -813,7 +820,7 @@ static int tda18271_tune(struct dvb_frontend *fe, | |||
813 | tda18271c2_rf_tracking_filters_correction(fe, freq); | 820 | tda18271c2_rf_tracking_filters_correction(fe, freq); |
814 | break; | 821 | break; |
815 | } | 822 | } |
816 | tda18271_channel_configuration(fe, map, freq, bw); | 823 | ret = tda18271_channel_configuration(fe, map, freq, bw); |
817 | 824 | ||
818 | mutex_unlock(&priv->lock); | 825 | mutex_unlock(&priv->lock); |
819 | fail: | 826 | fail: |