summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/musb_dsps.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-24 13:08:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-01 18:48:10 +0300
commit05678497276e1ff9394f7f815d80b1f2d47e92f4 (patch)
treebdcf8b49cacaf68fd4609662226755dba98c410c /drivers/usb/musb/musb_dsps.c
parent0c63636440504f0f14cc3da5fb208eeb1598a840 (diff)
downloadlinux-05678497276e1ff9394f7f815d80b1f2d47e92f4.tar.xz
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_dsps.c')
-rw-r--r--drivers/usb/musb/musb_dsps.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index f6b526606ad1..e3d0e626a5d6 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -282,9 +282,10 @@ static int dsps_check_status(struct musb *musb, void *unused)
return 0;
}
-static void otg_timer(unsigned long _musb)
+static void otg_timer(struct timer_list *t)
{
- struct musb *musb = (void *)_musb;
+ struct dsps_glue *glue = from_timer(glue, t, timer);
+ struct musb *musb = platform_get_drvdata(glue->musb);
struct device *dev = musb->controller;
unsigned long flags;
int err;
@@ -480,7 +481,7 @@ static int dsps_musb_init(struct musb *musb)
}
}
- setup_timer(&glue->timer, otg_timer, (unsigned long) musb);
+ timer_setup(&glue->timer, otg_timer, 0);
/* Reset the musb */
musb_writel(reg_base, wrp->control, (1 << wrp->reset));