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>
Este commit está contenido en:
Kees Cook
2017-10-24 03:08:35 -07:00
cometido por Greg Kroah-Hartman
padre 0c63636440
commit 0567849727
Se han modificado 9 ficheros con 55 adiciones y 64 borrados

Ver fichero

@@ -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));