Merge remote-tracking branch 'tip/timers/core' into afs-next
[linux-block.git] / drivers / net / hamradio / yam.c
index b6891ada1d7b7b67311fc8f1e6b04115ba341d11..14c3632b8cde3cc95a25d98bc3ff826ed529205e 100644 (file)
@@ -157,7 +157,7 @@ static struct net_device *yam_devs[NR_PORTS];
 
 static struct yam_mcs *yam_data;
 
-static DEFINE_TIMER(yam_timer, NULL, 0, 0);
+static DEFINE_TIMER(yam_timer, NULL);
 
 /* --------------------------------------------------------------------- */
 
@@ -647,7 +647,7 @@ static void yam_arbitrate(struct net_device *dev)
        yam_start_tx(dev, yp);
 }
 
-static void yam_dotimer(unsigned long dummy)
+static void yam_dotimer(struct timer_list *unused)
 {
        int i;
 
@@ -976,12 +976,10 @@ static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
        case SIOCYAMSMCS:
                if (netif_running(dev))
                        return -EINVAL;         /* Cannot change this parameter when up */
-               if ((ym = kmalloc(sizeof(struct yamdrv_ioctl_mcs), GFP_KERNEL)) == NULL)
-                       return -ENOBUFS;
-               if (copy_from_user(ym, ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs))) {
-                       kfree(ym);
-                       return -EFAULT;
-               }
+               ym = memdup_user(ifr->ifr_data,
+                                sizeof(struct yamdrv_ioctl_mcs));
+               if (IS_ERR(ym))
+                       return PTR_ERR(ym);
                if (ym->bitrate > YAM_MAXBITRATE) {
                        kfree(ym);
                        return -EINVAL;
@@ -1166,7 +1164,7 @@ static int __init yam_init_driver(void)
 
        }
 
-       yam_timer.function = yam_dotimer;
+       timer_setup(&yam_timer, yam_dotimer, 0);
        yam_timer.expires = jiffies + HZ / 100;
        add_timer(&yam_timer);