OSDN Git Service

net: nfc: hci: use setup_timer() helper.
authorAllen Pais <allen.lkml@gmail.com>
Mon, 25 Sep 2017 07:30:03 +0000 (13:00 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Sep 2017 20:19:20 +0000 (13:19 -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/hci/core.c

index b740fef..a8a6e78 100644 (file)
@@ -1004,9 +1004,8 @@ int nfc_hci_register_device(struct nfc_hci_dev *hdev)
 
        INIT_WORK(&hdev->msg_tx_work, nfc_hci_msg_tx_work);
 
-       init_timer(&hdev->cmd_timer);
-       hdev->cmd_timer.data = (unsigned long)hdev;
-       hdev->cmd_timer.function = nfc_hci_cmd_timeout;
+       setup_timer(&hdev->cmd_timer, nfc_hci_cmd_timeout,
+                   (unsigned long)hdev);
 
        skb_queue_head_init(&hdev->rx_hcp_frags);