Skip to content

Commit 6fa35bd

Browse files
keesdavem330
authored andcommitted
net: dl2k: 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: "David S. Miller" <davem@davemloft.net> Cc: Jarod Wilson <jarod@redhat.com> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Philippe Reynes <tremyfr@gmail.com> Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b09064b commit 6fa35bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/net/ethernet/dlink/dl2k.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static const int max_intrloop = 50;
6868
static const int multicast_filter_limit = 0x40;
6969

7070
static int rio_open (struct net_device *dev);
71-
static void rio_timer (unsigned long data);
71+
static void rio_timer (struct timer_list *t);
7272
static void rio_tx_timeout (struct net_device *dev);
7373
static netdev_tx_t start_xmit (struct sk_buff *skb, struct net_device *dev);
7474
static irqreturn_t rio_interrupt (int irq, void *dev_instance);
@@ -644,7 +644,7 @@ static int rio_open(struct net_device *dev)
644644
return i;
645645
}
646646

647-
setup_timer(&np->timer, rio_timer, (unsigned long)dev);
647+
timer_setup(&np->timer, rio_timer, 0);
648648
np->timer.expires = jiffies + 1 * HZ;
649649
add_timer(&np->timer);
650650

@@ -655,10 +655,10 @@ static int rio_open(struct net_device *dev)
655655
}
656656

657657
static void
658-
rio_timer (unsigned long data)
658+
rio_timer (struct timer_list *t)
659659
{
660-
struct net_device *dev = (struct net_device *)data;
661-
struct netdev_private *np = netdev_priv(dev);
660+
struct netdev_private *np = from_timer(np, t, timer);
661+
struct net_device *dev = pci_get_drvdata(np->pdev);
662662
unsigned int entry;
663663
int next_tick = 1*HZ;
664664
unsigned long flags;

0 commit comments

Comments
 (0)