mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
media: bttv-input: better handle errors at I2C transfer
The error handling logic at get_key_pv951() is a little bit akward, with produces this false positive warning: drivers/media/pci/bt8xx/bttv-input.c:344 get_key_pv951() error: uninitialized symbol 'b'. Do a cleanup. As a side effect, it also improves its coding style. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
b0121ca038
commit
d3c449e16f
1 changed files with 5 additions and 1 deletions
|
@ -332,11 +332,15 @@ static void bttv_ir_stop(struct bttv *btv)
|
||||||
static int get_key_pv951(struct IR_i2c *ir, enum rc_proto *protocol,
|
static int get_key_pv951(struct IR_i2c *ir, enum rc_proto *protocol,
|
||||||
u32 *scancode, u8 *toggle)
|
u32 *scancode, u8 *toggle)
|
||||||
{
|
{
|
||||||
|
int rc;
|
||||||
unsigned char b;
|
unsigned char b;
|
||||||
|
|
||||||
/* poll IR chip */
|
/* poll IR chip */
|
||||||
if (1 != i2c_master_recv(ir->c, &b, 1)) {
|
rc = i2c_master_recv(ir->c, &b, 1);
|
||||||
|
if (rc != 1) {
|
||||||
dprintk("read error\n");
|
dprintk("read error\n");
|
||||||
|
if (rc < 0)
|
||||||
|
return rc;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue