summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2013-01-13 13:20:45 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-02-05 22:43:16 (GMT)
commit9b4539bebb86310afdc5563653ec4475ae110088 (patch)
tree4c6f154da88212a29dc7abdc14bd5a75d29feb35 /drivers
parent1d968cdaaec2ea994b2656c00b5a4f10d4159fe8 (diff)
downloadlinux-fsl-qoriq-9b4539bebb86310afdc5563653ec4475ae110088.tar.xz
[media] em28xx: input: use common work_struct callback function for IR RC key polling
Remove em28xx_i2c_ir_work() and check the device type in the common callback function em28xx_ir_work() instead. Simplifies em28xx_ir_start(). Reduces the code size with a minor performance drawback. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 63b9728..1bef990 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -338,19 +338,14 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
}
}
-static void em28xx_i2c_ir_work(struct work_struct *work)
-{
- struct em28xx_IR *ir = container_of(work, struct em28xx_IR, work.work);
-
- em28xx_i2c_ir_handle_key(ir);
- schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling));
-}
-
static void em28xx_ir_work(struct work_struct *work)
{
struct em28xx_IR *ir = container_of(work, struct em28xx_IR, work.work);
- em28xx_ir_handle_key(ir);
+ if (ir->i2c_dev_addr) /* external i2c device */
+ em28xx_i2c_ir_handle_key(ir);
+ else /* internal device */
+ em28xx_ir_handle_key(ir);
schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling));
}
@@ -358,10 +353,7 @@ static int em28xx_ir_start(struct rc_dev *rc)
{
struct em28xx_IR *ir = rc->priv;
- if (ir->i2c_dev_addr) /* external i2c device */
- INIT_DELAYED_WORK(&ir->work, em28xx_i2c_ir_work);
- else /* internal device */
- INIT_DELAYED_WORK(&ir->work, em28xx_ir_work);
+ INIT_DELAYED_WORK(&ir->work, em28xx_ir_work);
schedule_delayed_work(&ir->work, 0);
return 0;