From d28bb967aa928d5cfd50a9a182f3b4218088c79d Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 16 Oct 2017 17:29:32 -0700 Subject: net: usb: Convert timers to use timer_setup() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Woojung Huh Cc: Microchip Linux Driver Support Cc: "David S. Miller" Cc: Ben Hutchings Cc: Philippe Reynes Cc: Jarod Wilson Cc: Arvind Yadav Cc: "Bjørn Mork" Cc: "Stefan Brüns" Cc: Alexey Dobriyan Cc: Greg Ungerer Cc: linux-usb@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: David S. Miller --- drivers/net/usb/catc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/usb/catc.c') diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c index aeb62e17d19d..18d36dff97ea 100644 --- a/drivers/net/usb/catc.c +++ b/drivers/net/usb/catc.c @@ -611,9 +611,9 @@ static void catc_stats_done(struct catc *catc, struct ctrl_queue *q) catc->stats_vals[index >> 1] = data; } -static void catc_stats_timer(unsigned long data) +static void catc_stats_timer(struct timer_list *t) { - struct catc *catc = (void *) data; + struct catc *catc = from_timer(catc, t, timer); int i; for (i = 0; i < 8; i++) @@ -805,7 +805,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id spin_lock_init(&catc->tx_lock); spin_lock_init(&catc->ctrl_lock); - setup_timer(&catc->timer, catc_stats_timer, (long)catc); + timer_setup(&catc->timer, catc_stats_timer, 0); catc->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL); catc->tx_urb = usb_alloc_urb(0, GFP_KERNEL); -- cgit v1.2.3