diff options
author | Eric Lapuyade <eric.lapuyade@intel.com> | 2012-05-07 06:31:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-15 17:31:22 -0400 |
commit | 03bed29e0501b5757ce62ebdb01829f7bd8d9819 (patch) | |
tree | 783752769aeb3ea994f68555dd12c9774f845077 /net/nfc | |
parent | 4333459fb71461b93d911cf5fbc5de4eb0ae3714 (diff) |
NFC: HCI drivers don't have to keep track of polling state
The NFC core code already does that for them.
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/hci/core.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 0fdb96f152b1..e1a640d2b588 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -251,11 +251,6 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, | |||
251 | 251 | ||
252 | switch (event) { | 252 | switch (event) { |
253 | case NFC_HCI_EVT_TARGET_DISCOVERED: | 253 | case NFC_HCI_EVT_TARGET_DISCOVERED: |
254 | if (hdev->poll_started == false) { | ||
255 | r = -EPROTO; | ||
256 | goto exit; | ||
257 | } | ||
258 | |||
259 | if (skb->len < 1) { /* no status data? */ | 254 | if (skb->len < 1) { /* no status data? */ |
260 | r = -EPROTO; | 255 | r = -EPROTO; |
261 | goto exit; | 256 | goto exit; |
@@ -489,28 +484,20 @@ static int hci_dev_down(struct nfc_dev *nfc_dev) | |||
489 | static int hci_start_poll(struct nfc_dev *nfc_dev, u32 protocols) | 484 | static int hci_start_poll(struct nfc_dev *nfc_dev, u32 protocols) |
490 | { | 485 | { |
491 | struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); | 486 | struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); |
492 | int r; | ||
493 | 487 | ||
494 | if (hdev->ops->start_poll) | 488 | if (hdev->ops->start_poll) |
495 | r = hdev->ops->start_poll(hdev, protocols); | 489 | return hdev->ops->start_poll(hdev, protocols); |
496 | else | 490 | else |
497 | r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, | 491 | return nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, |
498 | NFC_HCI_EVT_READER_REQUESTED, NULL, 0); | 492 | NFC_HCI_EVT_READER_REQUESTED, NULL, 0); |
499 | if (r == 0) | ||
500 | hdev->poll_started = true; | ||
501 | |||
502 | return r; | ||
503 | } | 493 | } |
504 | 494 | ||
505 | static void hci_stop_poll(struct nfc_dev *nfc_dev) | 495 | static void hci_stop_poll(struct nfc_dev *nfc_dev) |
506 | { | 496 | { |
507 | struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); | 497 | struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); |
508 | 498 | ||
509 | if (hdev->poll_started) { | 499 | nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, |
510 | nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, | 500 | NFC_HCI_EVT_END_OPERATION, NULL, 0); |
511 | NFC_HCI_EVT_END_OPERATION, NULL, 0); | ||
512 | hdev->poll_started = false; | ||
513 | } | ||
514 | } | 501 | } |
515 | 502 | ||
516 | static int hci_activate_target(struct nfc_dev *nfc_dev, | 503 | static int hci_activate_target(struct nfc_dev *nfc_dev, |