diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-21 00:12:34 -0700 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-11-21 15:46:44 -0800 |
commit | 72a9f9a445d4e296484aa5dfbfea6254d01f7cf5 (patch) | |
tree | 664dc548e6684555b1a9d141bdff1eab328dbe6b /drivers/usb/atm/speedtch.c | |
parent | ff07a23fec3f9ea28d22852097260b38903891c4 (diff) | |
download | op-kernel-dev-72a9f9a445d4e296484aa5dfbfea6254d01f7cf5.zip op-kernel-dev-72a9f9a445d4e296484aa5dfbfea6254d01f7cf5.tar.gz |
usb: usbatm: 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. Additionally corrects and on-stack
timer usage.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Duncan Sands <duncan.sands@free.fr>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: accessrunner-general@lists.sourceforge.net
Cc: linux-usb@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Allen Pais <allen.lkml@gmail.com>
Diffstat (limited to 'drivers/usb/atm/speedtch.c')
-rw-r--r-- | drivers/usb/atm/speedtch.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index 5a5e8c0..973548b 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c @@ -557,9 +557,10 @@ static void speedtch_check_status(struct work_struct *work) } } -static void speedtch_status_poll(unsigned long data) +static void speedtch_status_poll(struct timer_list *t) { - struct speedtch_instance_data *instance = (void *)data; + struct speedtch_instance_data *instance = from_timer(instance, t, + status_check_timer); schedule_work(&instance->status_check_work); @@ -570,9 +571,10 @@ static void speedtch_status_poll(unsigned long data) atm_warn(instance->usbatm, "Too many failures - disabling line status polling\n"); } -static void speedtch_resubmit_int(unsigned long data) +static void speedtch_resubmit_int(struct timer_list *t) { - struct speedtch_instance_data *instance = (void *)data; + struct speedtch_instance_data *instance = from_timer(instance, t, + resubmit_timer); struct urb *int_urb = instance->int_urb; int ret; @@ -860,13 +862,11 @@ static int speedtch_bind(struct usbatm_data *usbatm, usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0); INIT_WORK(&instance->status_check_work, speedtch_check_status); - setup_timer(&instance->status_check_timer, speedtch_status_poll, - (unsigned long)instance); + timer_setup(&instance->status_check_timer, speedtch_status_poll, 0); instance->last_status = 0xff; instance->poll_delay = MIN_POLL_DELAY; - setup_timer(&instance->resubmit_timer, speedtch_resubmit_int, - (unsigned long)instance); + timer_setup(&instance->resubmit_timer, speedtch_resubmit_int, 0); instance->int_urb = usb_alloc_urb(0, GFP_KERNEL); |