From 8939e47fc953cce6ef53e79e9ff9b53319d1a72d Mon Sep 17 00:00:00 2001 From: Ilan Elias Date: Wed, 18 Jan 2012 13:16:12 +0200 Subject: 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 Signed-off-by: John W. Linville --- net/nfc/nci/ntf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'net/nfc/nci/ntf.c') diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index a88be91e973f..8ec39464cea5 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c @@ -261,8 +261,7 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev, __u8 *data = skb->data; int err = 0; - clear_bit(NCI_DISCOVERY, &ndev->flags); - set_bit(NCI_POLL_ACTIVE, &ndev->flags); + atomic_set(&ndev->state, NCI_POLL_ACTIVE); ntf.rf_discovery_id = *data++; ntf.rf_interface = *data++; @@ -350,7 +349,7 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, pr_debug("entry, type 0x%x, reason 0x%x\n", ntf->type, ntf->reason); - clear_bit(NCI_POLL_ACTIVE, &ndev->flags); + atomic_set(&ndev->state, NCI_IDLE); ndev->target_active_prot = 0; /* drop tx data queue */ -- cgit v1.2.3