summaryrefslogtreecommitdiff
path: root/net/nfc/nci/ntf.c
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-02-03 19:48:07 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-02-04 09:14:09 +0100
commit15d4a8da0e440faf589a26346c8287e1ed0abe6c (patch)
treed6ddf14215118c72dff898f57b24535e68225878 /net/nfc/nci/ntf.c
parent3ba5c8466b320c3fd5d5861b34aa8a31dd0cf6b3 (diff)
NFC: nci: Move logical connection structure allocation
conn_info is currently allocated only after nfcee_discovery_ntf which is not generic enough for logical connection other than NFCEE. The corresponding conn_info is now created in nci_core_conn_create_rsp(). Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/nci/ntf.c')
-rw-r--r--net/nfc/nci/ntf.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 6bbbf6fdacc0..3218071072ac 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -723,7 +723,6 @@ static void nci_nfcee_discover_ntf_packet(struct nci_dev *ndev,
struct sk_buff *skb)
{
u8 status = NCI_STATUS_OK;
- struct nci_conn_info *conn_info;
struct nci_nfcee_discover_ntf *nfcee_ntf =
(struct nci_nfcee_discover_ntf *)skb->data;
@@ -734,27 +733,9 @@ static void nci_nfcee_discover_ntf_packet(struct nci_dev *ndev,
* and only one, NFCEE_DISCOVER_NTF with a Protocol type of
* “HCI Access”, even if the HCI Network contains multiple NFCEEs.
*/
- if (!ndev->hci_dev->conn_info) {
- conn_info = devm_kzalloc(&ndev->nfc_dev->dev,
- sizeof(*conn_info), GFP_KERNEL);
- if (!conn_info) {
- status = NCI_STATUS_REJECTED;
- goto exit;
- }
-
- conn_info->id = nfcee_ntf->nfcee_id;
- conn_info->conn_id = NCI_INVALID_CONN_ID;
-
- conn_info->data_exchange_cb = nci_hci_data_received_cb;
- conn_info->data_exchange_cb_context = ndev;
+ ndev->hci_dev->nfcee_id = nfcee_ntf->nfcee_id;
+ ndev->cur_id = nfcee_ntf->nfcee_id;
- INIT_LIST_HEAD(&conn_info->list);
- list_add(&conn_info->list, &ndev->conn_info_list);
-
- ndev->hci_dev->conn_info = conn_info;
- }
-
-exit:
nci_req_complete(ndev, status);
}