aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/mei/nfc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-20 15:48:19 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-20 15:48:19 -0800
commit9f67627a0fea99b080a190d2d24cc1e2634aa2f7 (patch)
tree24dcf714a8b502c7ef91086d9eb6164f68c7d52b /drivers/misc/mei/nfc.c
parent82b51734b4f228c76b6064b6e899d9d3d4c17c1a (diff)
parent6adb8efb024a7e413b93b22848fc13395b1a438a (diff)
Merge tag 'char-misc-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver patches from Greg KH: "Here's the big char/misc driver patches for 3.14-rc1. Lots of little things, and a new "big" driver, genwqe. Full details are in the shortlog" * tag 'char-misc-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (90 commits) mei: limit the number of consecutive resets mei: revamp mei reset state machine drivers/char: don't use module_init in non-modular ttyprintk.c VMCI: fix error handling path when registering guest driver extcon: gpio: Add power resume support Documentation: HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm) in ko_KR Documentation: HOWTO: update for 2.6.x -> 3.x versioning in ko_KR Documentation: HOWTO: update stable address in ko_KR Documentation: HOWTO: update LXR web link in ko_KR char: nwbutton: open-code interruptible_sleep_on mei: fix syntax in comments and debug output mei: nfc: mei_nfc_free has to be called under lock mei: use hbm idle state to prevent spurious resets mei: do not run reset flow from the interrupt thread misc: genwqe: fix return value check in genwqe_device_create() GenWQE: Fix warnings for sparc GenWQE: Fix compile problems for Alpha Documentation/misc-devices/mei/mei-amt-version.c: remove unneeded call of mei_deinit() GenWQE: Rework return code for flash-update ioctl sgi-xp: open-code interruptible_sleep_on_timeout ...
Diffstat (limited to 'drivers/misc/mei/nfc.c')
-rw-r--r--drivers/misc/mei/nfc.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/misc/mei/nfc.c b/drivers/misc/mei/nfc.c
index 994ca4aff1a3..a58320c0c049 100644
--- a/drivers/misc/mei/nfc.c
+++ b/drivers/misc/mei/nfc.c
@@ -92,7 +92,7 @@ struct mei_nfc_hci_hdr {
* @cl: NFC host client
* @cl_info: NFC info host client
* @init_work: perform connection to the info client
- * @fw_ivn: NFC Intervace Version Number
+ * @fw_ivn: NFC Interface Version Number
* @vendor_id: NFC manufacturer ID
* @radio_type: NFC radio type
*/
@@ -163,7 +163,7 @@ static int mei_nfc_build_bus_name(struct mei_nfc_dev *ndev)
return 0;
default:
- dev_err(&dev->pdev->dev, "Unknow radio type 0x%x\n",
+ dev_err(&dev->pdev->dev, "Unknown radio type 0x%x\n",
ndev->radio_type);
return -EINVAL;
@@ -175,14 +175,14 @@ static int mei_nfc_build_bus_name(struct mei_nfc_dev *ndev)
ndev->bus_name = "pn544";
return 0;
default:
- dev_err(&dev->pdev->dev, "Unknow radio type 0x%x\n",
+ dev_err(&dev->pdev->dev, "Unknown radio type 0x%x\n",
ndev->radio_type);
return -EINVAL;
}
default:
- dev_err(&dev->pdev->dev, "Unknow vendor ID 0x%x\n",
+ dev_err(&dev->pdev->dev, "Unknown vendor ID 0x%x\n",
ndev->vendor_id);
return -EINVAL;
@@ -428,7 +428,7 @@ static void mei_nfc_init(struct work_struct *work)
mutex_unlock(&dev->device_lock);
if (mei_nfc_if_version(ndev) < 0) {
- dev_err(&dev->pdev->dev, "Could not get the NFC interfave version");
+ dev_err(&dev->pdev->dev, "Could not get the NFC interface version");
goto err;
}
@@ -469,7 +469,9 @@ static void mei_nfc_init(struct work_struct *work)
return;
err:
+ mutex_lock(&dev->device_lock);
mei_nfc_free(ndev);
+ mutex_unlock(&dev->device_lock);
return;
}
@@ -481,7 +483,7 @@ int mei_nfc_host_init(struct mei_device *dev)
struct mei_cl *cl_info, *cl = NULL;
int i, ret;
- /* already initialzed */
+ /* already initialized */
if (ndev->cl_info)
return 0;
@@ -547,12 +549,16 @@ err:
return ret;
}
-void mei_nfc_host_exit(void)
+void mei_nfc_host_exit(struct mei_device *dev)
{
struct mei_nfc_dev *ndev = &nfc_dev;
+ cancel_work_sync(&ndev->init_work);
+
+ mutex_lock(&dev->device_lock);
if (ndev->cl && ndev->cl->device)
mei_cl_remove_device(ndev->cl->device);
mei_nfc_free(ndev);
+ mutex_unlock(&dev->device_lock);
}