Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: implicitly deactivate in nci_start_poll

When start_poll is called, and a target was implicitly activated,
we need to implicitly deactivate it.
On the other hand, when the target was activated by the user,
we should not deactivate it.

Signed-off-by: Ilan Elias <ilane@ti.com>
Acked-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Ilan Elias and committed by
John W. Linville
de054799 2eb1dc10

+6 -1
+6 -1
net/nfc/nci/core.c
··· 361 361 return -EBUSY; 362 362 } 363 363 364 + if (ndev->target_active_prot) { 365 + nfc_err("there is an active target"); 366 + return -EBUSY; 367 + } 368 + 364 369 if (test_bit(NCI_POLL_ACTIVE, &ndev->flags)) { 365 - nfc_dbg("target already active, first deactivate..."); 370 + nfc_dbg("target is active, implicitly deactivate..."); 366 371 367 372 rc = nci_request(ndev, nci_rf_deactivate_req, 0, 368 373 msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT));