Commit 7757dc8a authored by Samuel Ortiz's avatar Samuel Ortiz

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: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 7c5a54fb
...@@ -143,6 +143,11 @@ int nfc_start_poll(struct nfc_dev *dev, u32 im_protocols, u32 tm_protocols) ...@@ -143,6 +143,11 @@ int nfc_start_poll(struct nfc_dev *dev, u32 im_protocols, u32 tm_protocols)
goto error; goto error;
} }
if (!dev->dev_up) {
rc = -ENODEV;
goto error;
}
if (dev->polling) { if (dev->polling) {
rc = -EBUSY; rc = -EBUSY;
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment