diff options
| author | 2017-11-28 16:19:52 +0000 | |
|---|---|---|
| committer | 2017-11-28 16:19:52 +0000 | |
| commit | 69830d3909849dee33b9a2de88ece3d59c75a1b8 (patch) | |
| tree | 67e22ac989e782ddc104f186dee54d1675e76923 /net/nfc/core.c | |
| parent | ASoC: rk3399_gru_sound: Map BTN_0 to KEY_PLAYPAUSE (diff) | |
| parent | ASoC: add snd_soc_disconnect_sync() (diff) | |
| download | linux-dev-69830d3909849dee33b9a2de88ece3d59c75a1b8.tar.xz linux-dev-69830d3909849dee33b9a2de88ece3d59c75a1b8.zip | |
Merge branch 'topic/disconnect' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rcar
Diffstat (limited to 'net/nfc/core.c')
| -rw-r--r-- | net/nfc/core.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c index 5cf33df888c3..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,10 +1094,7 @@ 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; - + timer_setup(&dev->check_pres_timer, nfc_check_pres_timeout, 0); INIT_WORK(&dev->check_pres_work, nfc_check_pres_work); } @@ -1106,7 +1103,7 @@ struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, err_free_dev: kfree(dev); - return ERR_PTR(rc); + return NULL; } EXPORT_SYMBOL(nfc_allocate_device); |
