aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek/r8169.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-25 03:53:12 -0700
committerDavid S. Miller <davem@davemloft.net>2017-10-27 12:09:16 +0900
commit9de36ccf0891fbdfcc347a34bda009977d8dc2a8 (patch)
treeadfb1f74db112b77bc0c5fde55a953682f9554f1 /drivers/net/ethernet/realtek/r8169.c
parentdrivers/net: nuvoton: Convert timers to use timer_setup() (diff)
downloadlinux-dev-9de36ccf0891fbdfcc347a34bda009977d8dc2a8.tar.xz
linux-dev-9de36ccf0891fbdfcc347a34bda009977d8dc2a8.zip
drivers/net: realtek: 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: Realtek linux nic maintainers <nic_swsd@realtek.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: David Howells <dhowells@redhat.com> Cc: Jay Vosburgh <jay.vosburgh@canonical.com> Cc: Allen Pais <allen.lkml@gmail.com> Cc: Eric Dumazet <edumazet@google.com> Cc: Tobias Klauser <tklauser@distanz.ch> 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 '')
-rw-r--r--drivers/net/ethernet/realtek/r8169.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index a3c949ea7d1a..7dc4b6de31e6 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4401,10 +4401,9 @@ static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag)
schedule_work(&tp->wk.work);
}
-static void rtl8169_phy_timer(unsigned long __opaque)
+static void rtl8169_phy_timer(struct timer_list *t)
{
- struct net_device *dev = (struct net_device *)__opaque;
- struct rtl8169_private *tp = netdev_priv(dev);
+ struct rtl8169_private *tp = from_timer(tp, t, timer);
rtl_schedule_task(tp, RTL_FLAG_TASK_PHY_PENDING);
}
@@ -8454,7 +8453,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->opts1_mask = (tp->mac_version != RTL_GIGA_MAC_VER_01) ?
~(RxBOVF | RxFOVF) : ~0;
- setup_timer(&tp->timer, rtl8169_phy_timer, (unsigned long)dev);
+ timer_setup(&tp->timer, rtl8169_phy_timer, 0);
tp->rtl_fw = RTL_FIRMWARE_UNKNOWN;