diff mbox

[14/33] NFC: update PN544 HCI driver state when opened/closed

Message ID 1341605393-32056-15-git-send-email-sameo@linux.intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Samuel Ortiz July 6, 2012, 8:09 p.m. UTC
From: Eric Lapuyade <eric.lapuyade@intel.com>

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/nfc/pn544_hci.c |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/drivers/nfc/pn544_hci.c b/drivers/nfc/pn544_hci.c
index 457eac3..69df6fe 100644
--- a/drivers/nfc/pn544_hci.c
+++ b/drivers/nfc/pn544_hci.c
@@ -377,6 +377,9 @@  static int pn544_hci_open(struct nfc_shdlc *shdlc)
 
 	r = pn544_hci_enable(info, HCI_MODE);
 
+	if (r == 0)
+		info->state = PN544_ST_READY;
+
 out:
 	mutex_unlock(&info->info_lock);
 	return r;
@@ -393,6 +396,8 @@  static void pn544_hci_close(struct nfc_shdlc *shdlc)
 
 	pn544_hci_disable(info);
 
+	info->state = PN544_ST_COLD;
+
 out:
 	mutex_unlock(&info->info_lock);
 }