Skip to content

Commit

Permalink
[media] lgdt330x: fix behavior of read errors in lgdt330x_read_ucblocks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Dec 30, 2011
1 parent 7e7b828 commit 26110da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/dvb/frontends/lgdt330x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit 26110da

Please sign in to comment.