aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@collabora.com>2016-06-16 14:25:23 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2016-07-06 04:02:08 -0400
commit9f0c4542c49cbd041f2b6943b16644af0a3ff48f (patch)
treee9276c73f1638498861d5a2c47369b4a512a2cbd
parenta52bd7d2753b0567c71d604c640e9c4a86221756 (diff)
NFC: port100: Abort current command before switching RF off
If a command is still being processed by the device, the switch RF off command will be rejected. With this patch, the port100 driver calls port100_abort_cmd() before sending the switch RF off command. Signed-off-by: Thierry Escande <thierry.escande@collabora.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/nfc/port100.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
index 481cb435e19f..2b2330b235e6 100644
--- a/drivers/nfc/port100.c
+++ b/drivers/nfc/port100.c
@@ -1050,6 +1050,10 @@ static int port100_switch_rf(struct nfc_digital_dev *ddev, bool on)
1050 1050
1051 *skb_put(skb, 1) = on ? 1 : 0; 1051 *skb_put(skb, 1) = on ? 1 : 0;
1052 1052
1053 /* Cancel the last command if the device is being switched off */
1054 if (!on)
1055 port100_abort_cmd(ddev);
1056
1053 resp = port100_send_cmd_sync(dev, PORT100_CMD_SWITCH_RF, skb); 1057 resp = port100_send_cmd_sync(dev, PORT100_CMD_SWITCH_RF, skb);
1054 1058
1055 if (IS_ERR(resp)) 1059 if (IS_ERR(resp))