aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/nfc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/nfc.c')
-rw-r--r--drivers/misc/mei/nfc.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/misc/mei/nfc.c b/drivers/misc/mei/nfc.c
index a58320c0c049..3095fc514a65 100644
--- a/drivers/misc/mei/nfc.c
+++ b/drivers/misc/mei/nfc.c
@@ -364,7 +364,7 @@ static int mei_nfc_send(struct mei_cl_device *cldev, u8 *buf, size_t length)
364 if (!wait_event_interruptible_timeout(ndev->send_wq, 364 if (!wait_event_interruptible_timeout(ndev->send_wq,
365 ndev->recv_req_id == ndev->req_id, HZ)) { 365 ndev->recv_req_id == ndev->req_id, HZ)) {
366 dev_err(&dev->pdev->dev, "NFC MEI command timeout\n"); 366 dev_err(&dev->pdev->dev, "NFC MEI command timeout\n");
367 err = -ETIMEDOUT; 367 err = -ETIME;
368 } else { 368 } else {
369 ndev->req_id++; 369 ndev->req_id++;
370 } 370 }
@@ -502,7 +502,7 @@ int mei_nfc_host_init(struct mei_device *dev)
502 i = mei_me_cl_by_uuid(dev, &mei_nfc_info_guid); 502 i = mei_me_cl_by_uuid(dev, &mei_nfc_info_guid);
503 if (i < 0) { 503 if (i < 0) {
504 dev_info(&dev->pdev->dev, "nfc: failed to find the client\n"); 504 dev_info(&dev->pdev->dev, "nfc: failed to find the client\n");
505 ret = -ENOENT; 505 ret = -ENOTTY;
506 goto err; 506 goto err;
507 } 507 }
508 508
@@ -520,7 +520,7 @@ int mei_nfc_host_init(struct mei_device *dev)
520 i = mei_me_cl_by_uuid(dev, &mei_nfc_guid); 520 i = mei_me_cl_by_uuid(dev, &mei_nfc_guid);
521 if (i < 0) { 521 if (i < 0) {
522 dev_info(&dev->pdev->dev, "nfc: failed to find the client\n"); 522 dev_info(&dev->pdev->dev, "nfc: failed to find the client\n");
523 ret = -ENOENT; 523 ret = -ENOTTY;
524 goto err; 524 goto err;
525 } 525 }
526 526
@@ -552,13 +552,7 @@ err:
552void mei_nfc_host_exit(struct mei_device *dev) 552void mei_nfc_host_exit(struct mei_device *dev)
553{ 553{
554 struct mei_nfc_dev *ndev = &nfc_dev; 554 struct mei_nfc_dev *ndev = &nfc_dev;
555
556 cancel_work_sync(&ndev->init_work); 555 cancel_work_sync(&ndev->init_work);
556}
557 557
558 mutex_lock(&dev->device_lock);
559 if (ndev->cl && ndev->cl->device)
560 mei_cl_remove_device(ndev->cl->device);
561 558
562 mei_nfc_free(ndev);
563 mutex_unlock(&dev->device_lock);
564}