summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-03-11 08:15:48 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-11 08:15:48 -0300
commit8f93baf8768c71f00ff06b8b818c7ba04fa663f6 (patch)
tree0d11848f074a035fce804eb076b5c4915cd8ca0f /linux/drivers/media/video
parentf1ecc598eb4d5dcf96c771908ff51c48e734dde8 (diff)
parent0bf47672d2ce934563d0287172c9dbf911e8a3b3 (diff)
downloadmediapointer-dvb-s2-8f93baf8768c71f00ff06b8b818c7ba04fa663f6.tar.gz
mediapointer-dvb-s2-8f93baf8768c71f00ff06b8b818c7ba04fa663f6.tar.bz2
backout changeset
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-input.c24
-rw-r--r--linux/drivers/media/video/ir-kbd-i2c.c22
-rw-r--r--linux/drivers/media/video/saa6588.c26
3 files changed, 20 insertions, 52 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-input.c b/linux/drivers/media/video/em28xx/em28xx-input.c
index b97a1bc85..5382a6064 100644
--- a/linux/drivers/media/video/em28xx/em28xx-input.c
+++ b/linux/drivers/media/video/em28xx/em28xx-input.c
@@ -69,8 +69,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;
@@ -298,13 +297,6 @@ 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);
-}
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
static void em28xx_ir_work(void *data)
#else
@@ -314,28 +306,26 @@ static void em28xx_ir_work(struct work_struct *work)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
struct em28xx_IR *ir = data;
#else
- struct em28xx_IR *ir = container_of(work, struct em28xx_IR, work);
+ struct em28xx_IR *ir = container_of(work, struct em28xx_IR, work.work);
#endif
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);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
- INIT_WORK(&ir->work, em28xx_ir_work, ir);
+ INIT_DELAYED_WORK(&ir->work, em28xx_ir_work, ir);
#else
- INIT_WORK(&ir->work, em28xx_ir_work);
+ INIT_DELAYED_WORK(&ir->work, em28xx_ir_work);
#endif
- schedule_work(&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)
diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c
index a99aea49a..a0b78706d 100644
--- a/linux/drivers/media/video/ir-kbd-i2c.c
+++ b/linux/drivers/media/video/ir-kbd-i2c.c
@@ -280,12 +280,6 @@ static void ir_key_poll(struct IR_i2c *ir)
}
}
-static void ir_timer(unsigned long data)
-{
- struct IR_i2c *ir = (struct IR_i2c*)data;
- schedule_work(&ir->work);
-}
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void ir_work(void *data)
#else
@@ -295,7 +289,7 @@ static void ir_work(struct work_struct *work)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
struct IR_i2c *ir = data;
#else
- struct IR_i2c *ir = container_of(work, struct IR_i2c, work);
+ struct IR_i2c *ir = container_of(work, struct IR_i2c, work.work);
#endif
int polling_interval = 100;
@@ -305,7 +299,7 @@ static void ir_work(struct work_struct *work)
polling_interval = 50;
ir_key_poll(ir);
- mod_timer(&ir->timer, jiffies + msecs_to_jiffies(polling_interval));
+ schedule_delayed_work(&ir->work, msecs_to_jiffies(polling_interval));
}
/* ----------------------------------------------------------------------- */
@@ -462,14 +456,11 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
/* start polling via eventd */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
- INIT_WORK(&ir->work, ir_work, ir);
+ INIT_DELAYED_WORK(&ir->work, ir_work, ir);
#else
- INIT_WORK(&ir->work, ir_work);
+ INIT_DELAYED_WORK(&ir->work, ir_work);
#endif
- init_timer(&ir->timer);
- ir->timer.function = ir_timer;
- ir->timer.data = (unsigned long)ir;
- schedule_work(&ir->work);
+ schedule_delayed_work(&ir->work, 0);
return 0;
@@ -486,8 +477,7 @@ static int ir_detach(struct i2c_client *client)
struct IR_i2c *ir = i2c_get_clientdata(client);
/* kill outstanding polls */
- del_timer_sync(&ir->timer);
- flush_scheduled_work();
+ cancel_delayed_work_sync(&ir->work);
/* unregister devices */
input_unregister_device(ir->input);
diff --git a/linux/drivers/media/video/saa6588.c b/linux/drivers/media/video/saa6588.c
index ae96de5fd..d89d70892 100644
--- a/linux/drivers/media/video/saa6588.c
+++ b/linux/drivers/media/video/saa6588.c
@@ -77,8 +77,7 @@ MODULE_LICENSE("GPL");
struct saa6588 {
struct v4l2_subdev sd;
- struct work_struct work;
- struct timer_list timer;
+ struct delayed_work work;
spinlock_t lock;
unsigned char *buffer;
unsigned int buf_size;
@@ -323,13 +322,6 @@ static void saa6588_i2c_poll(struct saa6588 *s)
wake_up_interruptible(&s->read_queue);
}
-static void saa6588_timer(unsigned long data)
-{
- struct saa6588 *s = (struct saa6588 *)data;
-
- schedule_work(&s->work);
-}
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void saa6588_work(void *data)
#else
@@ -339,11 +331,11 @@ static void saa6588_work(struct work_struct *work)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
struct saa6588 *s = (struct saa6588 *)data;
#else
- struct saa6588 *s = container_of(work, struct saa6588, work);
+ struct saa6588 *s = container_of(work, struct saa6588, work.work);
#endif
saa6588_i2c_poll(s);
- mod_timer(&s->timer, jiffies + msecs_to_jiffies(20));
+ schedule_delayed_work(&s->work, msecs_to_jiffies(20));
}
static int saa6588_configure(struct saa6588 *s)
@@ -500,14 +492,11 @@ static int saa6588_probe(struct i2c_client *client,
/* start polling via eventd */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
- INIT_WORK(&s->work, saa6588_work, s);
+ INIT_DELAYED_WORK(&s->work, saa6588_work, s);
#else
- INIT_WORK(&s->work, saa6588_work);
+ INIT_DELAYED_WORK(&s->work, saa6588_work);
#endif
- init_timer(&s->timer);
- s->timer.function = saa6588_timer;
- s->timer.data = (unsigned long)s;
- schedule_work(&s->work);
+ schedule_delayed_work(&s->work, 0);
return 0;
}
@@ -518,8 +507,7 @@ static int saa6588_remove(struct i2c_client *client)
v4l2_device_unregister_subdev(sd);
- del_timer_sync(&s->timer);
- flush_scheduled_work();
+ cancel_delayed_work_sync(&s->work);
kfree(s->buffer);
kfree(s);