NFC: Update secure element state
authorArron Wang <arron.wang@intel.com>
Tue, 30 Jul 2013 12:40:05 +0000 (14:40 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 13 Aug 2013 23:13:40 +0000 (01:13 +0200)
The secure element state was not updated from the enable/disable ops,
leaving the SE state to disabled for ever.

Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/core.c

index ee1fe66e2c8ac7550aeb524b3ee91519603474bd..e92923cf3e0374f950417e5039ba2e61369c8e27 100644 (file)
@@ -589,6 +589,8 @@ int nfc_enable_se(struct nfc_dev *dev, u32 se_idx)
        }
 
        rc = dev->ops->enable_se(dev, se_idx);
+       if (rc >= 0)
+               se->state = NFC_SE_ENABLED;
 
 error:
        device_unlock(&dev->dev);
@@ -632,6 +634,8 @@ int nfc_disable_se(struct nfc_dev *dev, u32 se_idx)
        }
 
        rc = dev->ops->disable_se(dev, se_idx);
+       if (rc >= 0)
+               se->state = NFC_SE_DISABLED;
 
 error:
        device_unlock(&dev->dev);