Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138137
b: refs/heads/master
c: f263bac
h: refs/heads/master
i:
  138135: eb5bb2a
v: v3
  • Loading branch information
Jean Delvare authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 0a9de10 commit 49ead47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c61402bae843f1f7ec29a6fe81681be21c3d201c
refs/heads/master: f263bac9f7181df80b732b7bc11a7a4e38ca962f
22 changes: 6 additions & 16 deletions trunk/drivers/media/video/em28xx/em28xx-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ struct em28xx_IR {

/* poll external decoder */
int polling;
struct work_struct work;
struct timer_list timer;
struct delayed_work work;
unsigned int last_toggle:1;
unsigned int last_readcount;
unsigned int repeat_interval;
Expand Down Expand Up @@ -292,32 +291,23 @@ static void em28xx_ir_handle_key(struct em28xx_IR *ir)
return;
}

static void ir_timer(unsigned long data)
{
struct em28xx_IR *ir = (struct em28xx_IR *)data;

schedule_work(&ir->work);
}

static void em28xx_ir_work(struct work_struct *work)
{
struct em28xx_IR *ir = container_of(work, struct em28xx_IR, work);
struct em28xx_IR *ir = container_of(work, struct em28xx_IR, work.work);

em28xx_ir_handle_key(ir);
mod_timer(&ir->timer, jiffies + msecs_to_jiffies(ir->polling));
schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling));
}

static void em28xx_ir_start(struct em28xx_IR *ir)
{
setup_timer(&ir->timer, ir_timer, (unsigned long)ir);
INIT_WORK(&ir->work, em28xx_ir_work);
schedule_work(&ir->work);
INIT_DELAYED_WORK(&ir->work, em28xx_ir_work);
schedule_delayed_work(&ir->work, 0);
}

static void em28xx_ir_stop(struct em28xx_IR *ir)
{
del_timer_sync(&ir->timer);
flush_scheduled_work();
cancel_delayed_work_sync(&ir->work);
}

int em28xx_ir_init(struct em28xx *dev)
Expand Down

0 comments on commit 49ead47

Please sign in to comment.