diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-25 03:51:14 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-27 12:09:15 +0900 |
commit | 550acfb37ffeee9ff00f7f13f087ad1c33a74b29 (patch) | |
tree | e129c181d9dd28ffe0df8ef3722429129bb962b5 /drivers/net/can/usb | |
parent | 0ff624fbfefbb96db62d100bda84e4fbdabaf628 (diff) | |
download | linux-550acfb37ffeee9ff00f7f13f087ad1c33a74b29.tar.bz2 |
drivers/net: can: 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.
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Allen Pais <allen.lkml@gmail.com>
Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c index 7e10dbdded28..25a9b79cc42d 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c @@ -259,10 +259,13 @@ static int pcan_usb_write_mode(struct peak_usb_device *dev, u8 onoff) /* * handle end of waiting for the device to reset */ -static void pcan_usb_restart(unsigned long arg) +static void pcan_usb_restart(struct timer_list *t) { + struct pcan_usb *pdev = from_timer(pdev, t, restart_timer); + struct peak_usb_device *dev = &pdev->dev; + /* notify candev and netdev */ - peak_usb_restart_complete((struct peak_usb_device *)arg); + peak_usb_restart_complete(dev); } /* @@ -798,8 +801,7 @@ static int pcan_usb_init(struct peak_usb_device *dev) int err; /* initialize a timer needed to wait for hardware restart */ - setup_timer(&pdev->restart_timer, pcan_usb_restart, - (unsigned long)dev); + timer_setup(&pdev->restart_timer, pcan_usb_restart, 0); /* * explicit use of dev_xxx() instead of netdev_xxx() here: |