net:nfc: use setup_timer
authorAllen Pais <allen.lkml@gmail.com>
Thu, 21 Sep 2017 10:59:33 +0000 (16:29 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Sep 2017 22:47:57 +0000 (15:47 -0700)
Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/nfc/core.c

index 5cf33df..e5e23c2 100644 (file)
@@ -1094,9 +1094,8 @@ struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
        dev->targets_generation = 1;
 
        if (ops->check_presence) {
-               init_timer(&dev->check_pres_timer);
-               dev->check_pres_timer.data = (unsigned long)dev;
-               dev->check_pres_timer.function = nfc_check_pres_timeout;
+               setup_timer(&dev->check_pres_timer, nfc_check_pres_timeout,
+                           (unsigned long)dev);
 
                INIT_WORK(&dev->check_pres_work, nfc_check_pres_work);
        }