NFC: nfcmrvl: free reset gpio
authorVincent Cuissard <cuissard@marvell.com>
Tue, 3 Nov 2015 18:19:34 +0000 (19:19 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 4 Nov 2015 23:32:25 +0000 (00:32 +0100)
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>
drivers/nfc/nfcmrvl/main.c

index 8079ae0de21ebac54153e7202bb469ae413ed765..743c74c31cf0ba69ed4daf2bb2d4d86d6361c083 100644 (file)
@@ -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);
This page took 0.025358 seconds and 5 git commands to generate.