Commit 297fced0 authored by Kees Cook's avatar Kees Cook Committed by Mauro Carvalho Chehab

media: radio: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 162e6376
...@@ -281,9 +281,9 @@ static bool cadet_has_rds_data(struct cadet *dev) ...@@ -281,9 +281,9 @@ static bool cadet_has_rds_data(struct cadet *dev)
} }
static void cadet_handler(unsigned long data) static void cadet_handler(struct timer_list *t)
{ {
struct cadet *dev = (void *)data; struct cadet *dev = from_timer(dev, t, readtimer);
/* Service the RDS fifo */ /* Service the RDS fifo */
if (mutex_trylock(&dev->lock)) { if (mutex_trylock(&dev->lock)) {
...@@ -309,7 +309,6 @@ static void cadet_handler(unsigned long data) ...@@ -309,7 +309,6 @@ static void cadet_handler(unsigned long data)
/* /*
* Clean up and exit * Clean up and exit
*/ */
setup_timer(&dev->readtimer, cadet_handler, data);
dev->readtimer.expires = jiffies + msecs_to_jiffies(50); dev->readtimer.expires = jiffies + msecs_to_jiffies(50);
add_timer(&dev->readtimer); add_timer(&dev->readtimer);
} }
...@@ -318,7 +317,7 @@ static void cadet_start_rds(struct cadet *dev) ...@@ -318,7 +317,7 @@ static void cadet_start_rds(struct cadet *dev)
{ {
dev->rdsstat = 1; dev->rdsstat = 1;
outb(0x80, dev->io); /* Select RDS fifo */ outb(0x80, dev->io); /* Select RDS fifo */
setup_timer(&dev->readtimer, cadet_handler, (unsigned long)dev); timer_setup(&dev->readtimer, cadet_handler, 0);
dev->readtimer.expires = jiffies + msecs_to_jiffies(50); dev->readtimer.expires = jiffies + msecs_to_jiffies(50);
add_timer(&dev->readtimer); add_timer(&dev->readtimer);
} }
......
...@@ -543,13 +543,13 @@ static inline void fm_irq_common_cmd_resp_helper(struct fmdev *fmdev, u8 stage) ...@@ -543,13 +543,13 @@ static inline void fm_irq_common_cmd_resp_helper(struct fmdev *fmdev, u8 stage)
* interrupt process. Therefore reset stage index to re-enable default * interrupt process. Therefore reset stage index to re-enable default
* interrupts. So that next interrupt will be processed as usual. * interrupts. So that next interrupt will be processed as usual.
*/ */
static void int_timeout_handler(unsigned long data) static void int_timeout_handler(struct timer_list *t)
{ {
struct fmdev *fmdev; struct fmdev *fmdev;
struct fm_irq *fmirq; struct fm_irq *fmirq;
fmdbg("irq: timeout,trying to re-enable fm interrupts\n"); fmdbg("irq: timeout,trying to re-enable fm interrupts\n");
fmdev = (struct fmdev *)data; fmdev = from_timer(fmdev, t, irq_info.timer);
fmirq = &fmdev->irq_info; fmirq = &fmdev->irq_info;
fmirq->retry++; fmirq->retry++;
...@@ -1550,8 +1550,7 @@ int fmc_prepare(struct fmdev *fmdev) ...@@ -1550,8 +1550,7 @@ int fmc_prepare(struct fmdev *fmdev)
atomic_set(&fmdev->tx_cnt, 1); atomic_set(&fmdev->tx_cnt, 1);
fmdev->resp_comp = NULL; fmdev->resp_comp = NULL;
setup_timer(&fmdev->irq_info.timer, &int_timeout_handler, timer_setup(&fmdev->irq_info.timer, int_timeout_handler, 0);
(unsigned long)fmdev);
/*TODO: add FM_STIC_EVENT later */ /*TODO: add FM_STIC_EVENT later */
fmdev->irq_info.mask = FM_MAL_EVENT; fmdev->irq_info.mask = FM_MAL_EVENT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment