diff options
author | Christian Lamparter <chunkeey@gmail.com> | 2022-03-02 20:51:36 +0100 |
---|---|---|
committer | Kalle Valo <quic_kvalo@quicinc.com> | 2022-03-10 17:53:59 +0200 |
commit | 87ddb2fc29f10cf689ff0dfb88a19b7d3687006b (patch) | |
tree | 57860b35aa309f5ec8d94858fbc9ca37c5a489ca /drivers/net/wireless | |
parent | 23de0fa0d2a05ff71c7bc8df9d12c9f23be83f13 (diff) |
carl9170: devres-ing input_allocate_device
devres will take care of freeing the input_device once
it is no longer needed.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/f81a6ff3b02116c6a448c42eecb546ea5d46c108.1646250537.git.chunkeey@gmail.com
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/carl9170/main.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c index 9495b3da1978..e833052e9056 100644 --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c @@ -1494,7 +1494,7 @@ static int carl9170_register_wps_button(struct ar9170 *ar) if (!(ar->features & CARL9170_WPS_BUTTON)) return 0; - input = input_allocate_device(); + input = devm_input_allocate_device(&ar->udev->dev); if (!input) return -ENOMEM; @@ -1512,10 +1512,8 @@ static int carl9170_register_wps_button(struct ar9170 *ar) input_set_capability(input, EV_KEY, KEY_WPS_BUTTON); err = input_register_device(input); - if (err) { - input_free_device(input); + if (err) return err; - } ar->wps.pbc = input; return 0; @@ -2038,13 +2036,6 @@ void carl9170_unregister(struct ar9170 *ar) carl9170_debugfs_unregister(ar); #endif /* CONFIG_CARL9170_DEBUGFS */ -#ifdef CONFIG_CARL9170_WPC - if (ar->wps.pbc) { - input_unregister_device(ar->wps.pbc); - ar->wps.pbc = NULL; - } -#endif /* CONFIG_CARL9170_WPC */ - carl9170_cancel_worker(ar); cancel_work_sync(&ar->restart_work); |