summaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorVincent Cuissard <cuissard@marvell.com>2015-11-03 19:19:34 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-11-05 00:32:25 +0100
commitb2fe288eac7247f83b52377b4134ecc5cd856bf2 (patch)
tree0444295e1dd66c5e9dea119e0b23e429c695f63f /drivers/nfc
parentNFC: nfcmrvl: add a small wait after setting UART break (diff)
downloadlinux-b2fe288eac7247f83b52377b4134ecc5cd856bf2.tar.xz
linux-b2fe288eac7247f83b52377b4134ecc5cd856bf2.zip
NFC: nfcmrvl: free reset gpio
Reset GPIO shall be freed by the driver since the device used in devm_ calls can be still valid on unregister. If user removes the module and inserts it again, the devm_gpio_request will fail because the underlying physical device (e.g i2c) was not removed so the device management won't have freed the gpio. Signed-off-by: Vincent Cuissard <cuissard@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/nfcmrvl/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c
index 8079ae0de21e..743c74c31cf0 100644
--- a/drivers/nfc/nfcmrvl/main.c
+++ b/drivers/nfc/nfcmrvl/main.c
@@ -194,6 +194,9 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv)
nfcmrvl_fw_dnld_deinit(priv);
+ if (priv->config.reset_n_io)
+ devm_gpio_free(priv->dev, priv->config.reset_n_io);
+
nci_unregister_device(ndev);
nci_free_device(ndev);
kfree(priv);