Commit 03bed29e authored by Eric Lapuyade's avatar Eric Lapuyade Committed by John W. Linville
Browse files

NFC: HCI drivers don't have to keep track of polling state



The NFC core code already does that for them.
Signed-off-by: default avatarEric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4333459f
...@@ -84,8 +84,6 @@ struct nfc_hci_dev { ...@@ -84,8 +84,6 @@ struct nfc_hci_dev {
u8 gate2pipe[NFC_HCI_MAX_GATES]; u8 gate2pipe[NFC_HCI_MAX_GATES];
bool poll_started;
u8 sw_romlib; u8 sw_romlib;
u8 sw_patch; u8 sw_patch;
u8 sw_flashlib_major; u8 sw_flashlib_major;
......
...@@ -251,11 +251,6 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, ...@@ -251,11 +251,6 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event,
switch (event) { switch (event) {
case NFC_HCI_EVT_TARGET_DISCOVERED: case NFC_HCI_EVT_TARGET_DISCOVERED:
if (hdev->poll_started == false) {
r = -EPROTO;
goto exit;
}
if (skb->len < 1) { /* no status data? */ if (skb->len < 1) { /* no status data? */
r = -EPROTO; r = -EPROTO;
goto exit; goto exit;
...@@ -489,28 +484,20 @@ static int hci_dev_down(struct nfc_dev *nfc_dev) ...@@ -489,28 +484,20 @@ static int hci_dev_down(struct nfc_dev *nfc_dev)
static int hci_start_poll(struct nfc_dev *nfc_dev, u32 protocols) static int hci_start_poll(struct nfc_dev *nfc_dev, u32 protocols)
{ {
struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);
int r;
if (hdev->ops->start_poll) if (hdev->ops->start_poll)
r = hdev->ops->start_poll(hdev, protocols); return hdev->ops->start_poll(hdev, protocols);
else else
r = nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, return nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE,
NFC_HCI_EVT_READER_REQUESTED, NULL, 0); NFC_HCI_EVT_READER_REQUESTED, NULL, 0);
if (r == 0)
hdev->poll_started = true;
return r;
} }
static void hci_stop_poll(struct nfc_dev *nfc_dev) static void hci_stop_poll(struct nfc_dev *nfc_dev)
{ {
struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);
if (hdev->poll_started) { nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE,
nfc_hci_send_event(hdev, NFC_HCI_RF_READER_A_GATE, NFC_HCI_EVT_END_OPERATION, NULL, 0);
NFC_HCI_EVT_END_OPERATION, NULL, 0);
hdev->poll_started = false;
}
} }
static int hci_activate_target(struct nfc_dev *nfc_dev, static int hci_activate_target(struct nfc_dev *nfc_dev,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment