]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pcmcia: m32r: Convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Mon, 16 Oct 2017 23:27:53 +0000 (16:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Oct 2017 13:17:44 +0000 (15:17 +0200)
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: Andrew Morton <akpm@linux-foundation.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: linux-pcmcia@lists.infradead.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pcmcia/m32r_cfc.c
drivers/pcmcia/m32r_pcc.c

index 70b089430fcc45ace3f3698d3282c7cae427303c..9a4940e56e2f57a946b2a74ebef62f77f148700d 100644 (file)
@@ -380,11 +380,10 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
        return IRQ_RETVAL(handled);
 } /* pcc_interrupt */
 
-static void pcc_interrupt_wrapper(u_long data)
+static void pcc_interrupt_wrapper(struct timer_list *unused)
 {
        pr_debug("m32r_cfc: pcc_interrupt_wrapper:\n");
        pcc_interrupt(0, NULL);
-       init_timer(&poll_timer);
        poll_timer.expires = jiffies + poll_interval;
        add_timer(&poll_timer);
 }
@@ -758,9 +757,7 @@ static int __init init_m32r_pcc(void)
 
        /* Finally, schedule a polling interrupt */
        if (poll_interval != 0) {
-               poll_timer.function = pcc_interrupt_wrapper;
-               poll_timer.data = 0;
-               init_timer(&poll_timer);
+               timer_setup(&poll_timer, pcc_interrupt_wrapper, 0);
                poll_timer.expires = jiffies + poll_interval;
                add_timer(&poll_timer);
        }
index e50bbf8261885dcd123389f63377b1a7270b609b..c2239a7e383a969221ccdf2e65c0a27e06446da7 100644 (file)
@@ -386,10 +386,9 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
        return IRQ_RETVAL(handled);
 } /* pcc_interrupt */
 
-static void pcc_interrupt_wrapper(u_long data)
+static void pcc_interrupt_wrapper(struct timer_list *unused)
 {
        pcc_interrupt(0, NULL);
-       init_timer(&poll_timer);
        poll_timer.expires = jiffies + poll_interval;
        add_timer(&poll_timer);
 }
@@ -729,9 +728,7 @@ static int __init init_m32r_pcc(void)
 
        /* Finally, schedule a polling interrupt */
        if (poll_interval != 0) {
-               poll_timer.function = pcc_interrupt_wrapper;
-               poll_timer.data = 0;
-               init_timer(&poll_timer);
+               timer_setup(&poll_timer, pcc_interrupt_wrapper, 0);
                poll_timer.expires = jiffies + poll_interval;
                add_timer(&poll_timer);
        }