diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-24 03:08:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-01 16:48:10 +0100 |
commit | 05678497276e1ff9394f7f815d80b1f2d47e92f4 (patch) | |
tree | bdcf8b49cacaf68fd4609662226755dba98c410c /drivers/usb/musb/musb_core.c | |
parent | 0c63636440504f0f14cc3da5fb208eeb1598a840 (diff) | |
download | linux-stable-05678497276e1ff9394f7f815d80b1f2d47e92f4.tar.gz linux-stable-05678497276e1ff9394f7f815d80b1f2d47e92f4.tar.bz2 linux-stable-05678497276e1ff9394f7f815d80b1f2d47e92f4.zip |
usb: musb: 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.
Instead of a per-device static timer variable, a spare timer "dev_timer"
is added to the musb structure for devices to use for their per-device
timer.
Cc: linux-usb@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 889ca9b164c4..82a5089caa34 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -485,9 +485,9 @@ void musb_load_testpacket(struct musb *musb) /* * Handles OTG hnp timeouts, such as b_ase0_brst */ -static void musb_otg_timer_func(unsigned long data) +static void musb_otg_timer_func(struct timer_list *t) { - struct musb *musb = (struct musb *)data; + struct musb *musb = from_timer(musb, t, otg_timer); unsigned long flags; spin_lock_irqsave(&musb->lock, flags); @@ -2331,7 +2331,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) if (status < 0) goto fail3; - setup_timer(&musb->otg_timer, musb_otg_timer_func, (unsigned long) musb); + timer_setup(&musb->otg_timer, musb_otg_timer_func, 0); /* attach to the IRQ */ if (request_irq(nIrq, musb->isr, IRQF_SHARED, dev_name(dev), musb)) { |