diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2011-12-15 10:16:09 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-30 15:57:29 -0200 |
commit | 26110dac8b3b30a99555d85fc1308a21fba5b746 (patch) | |
tree | 5b2225de2991ccc7b4a182bcfa342616638b8413 /drivers/media/dvb/frontends/lgdt330x.c | |
parent | 7e7b8287af32400daea1e231057b4b75934af347 (diff) |
[media] lgdt330x: fix behavior of read errors in lgdt330x_read_ucblocks
initialize *ucblocks to zero & fix the following build warning:
lgdt330x.c: In function "lgdt330x_read_ucblocks":
lgdt330x.c:288:6: warning: variable "err" set but not used
[-Wunused-but-set-variable]
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/lgdt330x.c')
-rw-r--r-- | drivers/media/dvb/frontends/lgdt330x.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c index 43971e63baa..d45827158a2 100644 --- a/drivers/media/dvb/frontends/lgdt330x.c +++ b/drivers/media/dvb/frontends/lgdt330x.c @@ -288,6 +288,8 @@ static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) int err; u8 buf[2]; + *ucblocks = 0; + switch (state->config->demod_chip) { case LGDT3302: err = i2c_read_demod_bytes(state, LGDT3302_PACKET_ERR_COUNTER1, @@ -302,6 +304,8 @@ static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) "Only LGDT3302 and LGDT3303 are supported chips.\n"); err = -ENODEV; } + if (err < 0) + return err; *ucblocks = (buf[0] << 8) | buf[1]; return 0; |