aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx231xx/cx231xx-input.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-01-09 22:28:13 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-10 22:35:28 -0200
commit90bf3aab42937f760e5b645ab63df46d26b5e620 (patch)
treeed1dec61c0283b4ef0beae71dbbebbf11bf57b4c /drivers/media/video/cx231xx/cx231xx-input.c
parent[media] cx231xx: remove useless 'lif' variable in cx231xx_usb_probe() (diff)
downloadlinux-dev-90bf3aab42937f760e5b645ab63df46d26b5e620.tar.xz
linux-dev-90bf3aab42937f760e5b645ab63df46d26b5e620.zip
[media] cx231xx-input: stop polling if the device got removed.
If the device got removed, stops polling it. Also, un-registers it at input/evdev, as it won't work anymore. We can't free the IR structure yet, as the ir_remove method will be called later. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-input.c')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-input.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-input.c b/drivers/media/video/cx231xx/cx231xx-input.c
index 45e14cac4622..8a75a908e709 100644
--- a/drivers/media/video/cx231xx/cx231xx-input.c
+++ b/drivers/media/video/cx231xx/cx231xx-input.c
@@ -27,12 +27,16 @@
static int get_key_isdbt(struct IR_i2c *ir, u32 *ir_key,
u32 *ir_raw)
{
+ int rc;
u8 cmd, scancode;
dev_dbg(&ir->rc->input_dev->dev, "%s\n", __func__);
/* poll IR chip */
- if (1 != i2c_master_recv(ir->c, &cmd, 1))
+ rc = i2c_master_recv(ir->c, &cmd, 1);
+ if (rc < 0)
+ return rc;
+ if (rc != 1)
return -EIO;
/* it seems that 0xFE indicates that a button is still hold