提交 728d9fd9 编写于 作者: M Mauro Carvalho Chehab

media: em28xx-input: improve error handling code

The current I2C error handling logic makes static analyzers
confused:

	drivers/media/usb/em28xx/em28xx-input.c:96 em28xx_get_key_terratec() error: uninitialized symbol 'b'.

Change it to match the coding style we're using elsewhere.
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 2be09d8d
...@@ -82,11 +82,16 @@ struct em28xx_IR { ...@@ -82,11 +82,16 @@ struct em28xx_IR {
static int em28xx_get_key_terratec(struct i2c_client *i2c_dev, static int em28xx_get_key_terratec(struct i2c_client *i2c_dev,
enum rc_proto *protocol, u32 *scancode) enum rc_proto *protocol, u32 *scancode)
{ {
int rc;
unsigned char b; unsigned char b;
/* poll IR chip */ /* poll IR chip */
if (i2c_master_recv(i2c_dev, &b, 1) != 1) rc = i2c_master_recv(i2c_dev, &b, 1);
if (rc != 1) {
if (rc < 0)
return rc;
return -EIO; return -EIO;
}
/* /*
* it seems that 0xFE indicates that a button is still hold * it seems that 0xFE indicates that a button is still hold
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册