]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net/ethernet/sgi: Convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Tue, 17 Oct 2017 00:29:31 +0000 (17:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Oct 2017 11:40:26 +0000 (12:40 +0100)
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: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sgi/ioc3-eth.c

index 9c0488e0f08ec2af6e075acd696c54900a648325..18d533fdf14c491a1afa48ea83a27103ac340caf 100644 (file)
@@ -764,9 +764,9 @@ static inline void ioc3_setup_duplex(struct ioc3_private *ip)
        ioc3_w_emcr(ip->emcr);
 }
 
-static void ioc3_timer(unsigned long data)
+static void ioc3_timer(struct timer_list *t)
 {
-       struct ioc3_private *ip = (struct ioc3_private *) data;
+       struct ioc3_private *ip = from_timer(ip, t, ioc3_timer);
 
        /* Print the link status if it has changed */
        mii_check_media(&ip->mii, 1, 0);
@@ -818,8 +818,6 @@ out:
 static void ioc3_mii_start(struct ioc3_private *ip)
 {
        ip->ioc3_timer.expires = jiffies + (12 * HZ)/10;  /* 1.2 sec. */
-       ip->ioc3_timer.data = (unsigned long) ip;
-       ip->ioc3_timer.function = ioc3_timer;
        add_timer(&ip->ioc3_timer);
 }
 
@@ -1291,7 +1289,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 #endif
 
        spin_lock_init(&ip->ioc3_lock);
-       init_timer(&ip->ioc3_timer);
+       timer_setup(&ip->ioc3_timer, ioc3_timer, 0);
 
        ioc3_stop(ip);
        ioc3_init(dev);