diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-10 06:25:30 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-11 10:29:10 -0400 |
commit | 7757dc8a3e7658abb6e5fc7d825a38b27961d0c8 (patch) | |
tree | baf60c1117faa0c747d0330d9b9c15e031f18628 /net/nfc | |
parent | 7c5a54fb869d980c2a3c0972fe1e22816dd5b7b2 (diff) |
NFC: Prevent polling when device is down
Some devices turn radio on whenever they're asked to start a poll.
To prevent that from happening, we just don't call into the driver
start_poll hook when the NFC device is down.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c index 6ceee8e181ca..c571ca9a960c 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c | |||
@@ -143,6 +143,11 @@ int nfc_start_poll(struct nfc_dev *dev, u32 im_protocols, u32 tm_protocols) | |||
143 | goto error; | 143 | goto error; |
144 | } | 144 | } |
145 | 145 | ||
146 | if (!dev->dev_up) { | ||
147 | rc = -ENODEV; | ||
148 | goto error; | ||
149 | } | ||
150 | |||
146 | if (dev->polling) { | 151 | if (dev->polling) { |
147 | rc = -EBUSY; | 152 | rc = -EBUSY; |
148 | goto error; | 153 | goto error; |