spinlock_t lock;
     struct net_device *next_module;
     struct timer_list timer;   /* Media selection timer. */
+    struct net_device *dev;    /* Timer dev. */
     unsigned long last_rx_time;        /* Last Rx, in jiffies, to handle Rx hang. */
     int saved_tx_size;
     unsigned int tx_unit_busy:1;
 #define TIMED_CHECKER (HZ/4)
 #ifdef TIMED_CHECKER
 #include <linux/timer.h>
-static void atp_timed_checker(unsigned long ignored);
+static void atp_timed_checker(struct timer_list *t);
 #endif
 
 /* Index to functions, as function prototypes. */
 
        hardware_init(dev);
 
-       setup_timer(&lp->timer, atp_timed_checker, (unsigned long)dev);
+       lp->dev = dev;
+       timer_setup(&lp->timer, atp_timed_checker, 0);
        lp->timer.expires = jiffies + TIMED_CHECKER;
        add_timer(&lp->timer);
 
 #ifdef TIMED_CHECKER
 /* This following code fixes a rare (and very difficult to track down)
    problem where the adapter forgets its ethernet address. */
-static void atp_timed_checker(unsigned long data)
+static void atp_timed_checker(struct timer_list *t)
 {
-       struct net_device *dev = (struct net_device *)data;
+       struct net_local *lp = from_timer(lp, t, timer);
+       struct net_device *dev = lp->dev;
        long ioaddr = dev->base_addr;
-       struct net_local *lp = netdev_priv(dev);
        int tickssofar = jiffies - lp->last_rx_time;
        int i;
 
 
                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);
 }
        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;