X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=net%2Fnfc%2Fhci%2Fcore.c;h=545c19f17536f218af6b709e12558d4384011a18;hb=900994332675f84a9fbbb33ff089474614c7f2fe;hp=86fd00d5a0992ace69730780c526fc8a9a17be2c;hpb=536acc085c641ff8ba46c2c0e97b5e137cbc22d6;p=deliverable%2Flinux.git diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 86fd00d5a099..545c19f17536 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c @@ -520,50 +520,26 @@ static void hci_stop_poll(struct nfc_dev *nfc_dev) } } -static struct nfc_target *hci_find_target(struct nfc_hci_dev *hdev, - u32 target_idx) +static int hci_activate_target(struct nfc_dev *nfc_dev, + struct nfc_target *target, u32 protocol) { - int i; - if (hdev->poll_started == false || hdev->targets == NULL) - return NULL; - - for (i = 0; i < hdev->target_count; i++) { - if (hdev->targets[i].idx == target_idx) - return &hdev->targets[i]; - } - - return NULL; -} - -static int hci_activate_target(struct nfc_dev *nfc_dev, u32 target_idx, - u32 protocol) -{ - struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); - - if (hci_find_target(hdev, target_idx) == NULL) - return -ENOMEDIUM; - return 0; } -static void hci_deactivate_target(struct nfc_dev *nfc_dev, u32 target_idx) +static void hci_deactivate_target(struct nfc_dev *nfc_dev, + struct nfc_target *target) { } -static int hci_data_exchange(struct nfc_dev *nfc_dev, u32 target_idx, +static int hci_data_exchange(struct nfc_dev *nfc_dev, struct nfc_target *target, struct sk_buff *skb, data_exchange_cb_t cb, void *cb_context) { struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); int r; - struct nfc_target *target; struct sk_buff *res_skb = NULL; - pr_debug("target_idx=%d\n", target_idx); - - target = hci_find_target(hdev, target_idx); - if (target == NULL) - return -ENOMEDIUM; + pr_debug("target_idx=%d\n", target->idx); switch (target->hci_reader_gate) { case NFC_HCI_RF_READER_A_GATE: