Skip to content

Commit

Permalink
NFC: nfcmrvl: free reset gpio
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vincent Cuissard authored and Samuel Ortiz committed Nov 4, 2015
1 parent d2d2e64 commit b2fe288
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/nfc/nfcmrvl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b2fe288

Please sign in to comment.