summaryrefslogtreecommitdiffstats
path: root/net/nfc/core.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-12-22 01:00:20 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2014-01-04 03:32:27 +0100
commita434c2407467a76c0e1416c45f7b31cfbe1b6b3b (patch)
tree8196e033b758b00b50e56c8223222834fbb443df /net/nfc/core.c
parent11bfb1c4b94fe24a83ebeae5c3310280f9606e0e (diff)
downloadlinux-a434c2407467a76c0e1416c45f7b31cfbe1b6b3b.tar.bz2
NFC: Only warn on SE discovery error
SE discovery errors are currently overwriting the dev_up() return error. This is wrong for many reasons: - We don't want to report an error if we actually brought the device up but it failed to discover SEs. By doing so we pretend we don't have an NFC functional device even we do. The only thing we could not do was checking for SEs availability. This is the false negative case. - In some cases the actual device power up failed but the SE discovery succeeded. Userspace then believes the device is up while it's not. This is the false positive case. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/core.c')
-rw-r--r--net/nfc/core.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index 02ab34132157..c1903f439aac 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -133,11 +133,8 @@ int nfc_dev_up(struct nfc_dev *dev)
dev->dev_up = true;
/* We have to enable the device before discovering SEs */
- if (dev->ops->discover_se) {
- rc = dev->ops->discover_se(dev);
- if (rc)
- pr_warn("SE discovery failed\n");
- }
+ if (dev->ops->discover_se && dev->ops->discover_se(dev))
+ pr_err("SE discovery failed\n");
error:
device_unlock(&dev->dev);