aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-02-03 13:48:08 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2015-02-04 03:15:18 -0500
commitfa00e8fed457841cb24219dbe3cfba7d56de6317 (patch)
treece8a4fa1b3719974644294685e5936fe9bead51d /net/nfc
parent15d4a8da0e440faf589a26346c8287e1ed0abe6c (diff)
NFC: nci: Move NFCEE discovery logic
NFCEE_DISCOVER_CMD is a specified NCI command used to discover NFCEE IDs. Move nci_nfcee_discover() call to nci_discover_se() in order to guarantee: - NFCEE_DISCOVER_CMD run when the NCI state machine is initialized - NFCEE_DISCOVER_CMD is not run in case there is not discover_se hook defined by a NFC device driver. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index ddfe91e43c88..9575a1892607 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -880,10 +880,16 @@ static int nci_disable_se(struct nfc_dev *nfc_dev, u32 se_idx)
880 880
881static int nci_discover_se(struct nfc_dev *nfc_dev) 881static int nci_discover_se(struct nfc_dev *nfc_dev)
882{ 882{
883 int r;
883 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); 884 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
884 885
885 if (ndev->ops->discover_se) 886 if (ndev->ops->discover_se) {
887 r = nci_nfcee_discover(ndev, NCI_NFCEE_DISCOVERY_ACTION_ENABLE);
888 if (r != NCI_STATUS_OK)
889 return -EPROTO;
890
886 return ndev->ops->discover_se(ndev); 891 return ndev->ops->discover_se(ndev);
892 }
887 893
888 return 0; 894 return 0;
889} 895}