From 4b519bb493e0866de7659b88dd22dc2cd89dd628 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Wed, 11 Oct 2017 16:03:44 +0530 Subject: 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 Reviewed-by: Kees Cook Signed-off-by: Samuel Ortiz --- net/nfc/core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'net/nfc/core.c') 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); } -- cgit v1.2.3