diff options
author | Eric Lapuyade <eric.lapuyade@linux.intel.com> | 2012-10-02 17:27:36 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-10-26 18:26:46 +0200 |
commit | 632c016ab8ba1f98262bd6242b38d73ee4ae652e (patch) | |
tree | 7349250c5faa50c93a48ee5eba81e9fdad682439 /net/nfc | |
parent | da052850b911dfd0fcd5c8d6308917ebe2edbacf (diff) | |
download | talos-op-linux-632c016ab8ba1f98262bd6242b38d73ee4ae652e.tar.gz talos-op-linux-632c016ab8ba1f98262bd6242b38d73ee4ae652e.zip |
NFC: HCI check presence must not fail when driver doesn't support it
When the driver does not support checking the tag is still present, it
must return -EOPNOTSUPP. The NFC Core will then stop asking and not
report a tag lost event to user space.
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c index 479bee36dc3e..4cb069766ce5 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -697,6 +697,8 @@ static void nfc_check_pres_work(struct work_struct *work) if (dev->active_target && timer_pending(&dev->check_pres_timer) == 0) { rc = dev->ops->check_presence(dev, dev->active_target); + if (rc == -EOPNOTSUPP) + goto exit; if (!rc) { mod_timer(&dev->check_pres_timer, jiffies + msecs_to_jiffies(NFC_CHECK_PRES_FREQ_MS)); @@ -708,6 +710,7 @@ static void nfc_check_pres_work(struct work_struct *work) } } +exit: device_unlock(&dev->dev); } |