diff options
author | Ilan Elias <ilane@ti.com> | 2012-01-18 11:16:12 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 19:32:28 (GMT) |
commit | 8939e47fc953cce6ef53e79e9ff9b53319d1a72d (patch) | |
tree | fba0ffe539b4d6937bfb2bd9986fe989917b8039 /net/nfc/nci/rsp.c | |
parent | 6d810f10325522cfcf498dc6d64b9f96e1f5153f (diff) | |
download | linux-fsl-qoriq-8939e47fc953cce6ef53e79e9ff9b53319d1a72d.tar.xz |
NFC: Clearly separate NCI states from flags
Make a clear separation between NCI states and flags.
This is required in order to support more NCI states (e.g.
for multiple targets support).
Signed-off-by: Ilan Elias <ilane@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc/nci/rsp.c')
-rw-r--r-- | net/nfc/nci/rsp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c index 3c73e92..cb8bce6 100644 --- a/net/nfc/nci/rsp.c +++ b/net/nfc/nci/rsp.c @@ -137,7 +137,7 @@ static void nci_rf_disc_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) pr_debug("status 0x%x\n", status); if (status == NCI_STATUS_OK) - set_bit(NCI_DISCOVERY, &ndev->flags); + atomic_set(&ndev->state, NCI_DISCOVERY); nci_req_complete(ndev, status); } @@ -149,12 +149,12 @@ static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev, pr_debug("status 0x%x\n", status); - clear_bit(NCI_DISCOVERY, &ndev->flags); - /* If target was active, complete the request only in deactivate_ntf */ if ((status != NCI_STATUS_OK) || - (!test_bit(NCI_POLL_ACTIVE, &ndev->flags))) + (atomic_read(&ndev->state) != NCI_POLL_ACTIVE)) { + atomic_set(&ndev->state, NCI_IDLE); nci_req_complete(ndev, status); + } } void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) |