summaryrefslogtreecommitdiff
path: root/net/nfc/core.c
diff options
context:
space:
mode:
authorAllen Pais <allen.pais@oracle.com>2017-10-11 16:03:44 +0530
committerSamuel Ortiz <sameo@linux.intel.com>2017-11-06 01:12:10 +0100
commit4b519bb493e0866de7659b88dd22dc2cd89dd628 (patch)
tree602ab6e52ef2a670b8c6f7ce5c5c9f4a5547ca44 /net/nfc/core.c
parent81ade1cd6761e791904801ca9bfc960de4b94916 (diff)
NFC: Convert timers to use timer_setup()
Switch to using the new timer_setup() and from_timer() for net/nfc/* Signed-off-by: Allen Pais <allen.pais@oracle.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/core.c')
-rw-r--r--net/nfc/core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index 2c7c9b357e70..947a470f929d 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -1015,9 +1015,9 @@ exit:
device_unlock(&dev->dev);
}
-static void nfc_check_pres_timeout(unsigned long data)
+static void nfc_check_pres_timeout(struct timer_list *t)
{
- struct nfc_dev *dev = (struct nfc_dev *)data;
+ struct nfc_dev *dev = from_timer(dev, t, check_pres_timer);
schedule_work(&dev->check_pres_work);
}
@@ -1094,9 +1094,7 @@ struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
dev->targets_generation = 1;
if (ops->check_presence) {
- setup_timer(&dev->check_pres_timer, nfc_check_pres_timeout,
- (unsigned long)dev);
-
+ timer_setup(&dev->check_pres_timer, nfc_check_pres_timeout, 0);
INIT_WORK(&dev->check_pres_work, nfc_check_pres_work);
}