summaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@animalcreek.com>2014-03-25 11:54:30 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-04-21 18:37:26 -0400
commit5876bc75e2d3174cd1cd944ee33edc77cd1173ca (patch)
tree96159c619acadadc67a2e278655170bdc3fe70b9 /drivers/nfc
parent5fa3af352b991e2e5c674728411d1cc4a4923e4d (diff)
NFC: trf7970a: Only abort a command if one is active
Only initiate the abort command process when there is an active command. If the abort process were started and there wasn't an active command then the next command issued by the digital layer would be incorrectly aborted. Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/trf7970a.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 9c93fbef4964..cab302ce2c7e 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -1191,7 +1191,18 @@ static void trf7970a_abort_cmd(struct nfc_digital_dev *ddev)
1191 dev_dbg(trf->dev, "Abort process initiated\n"); 1191 dev_dbg(trf->dev, "Abort process initiated\n");
1192 1192
1193 mutex_lock(&trf->lock); 1193 mutex_lock(&trf->lock);
1194 trf->aborting = true; 1194
1195 switch (trf->state) {
1196 case TRF7970A_ST_WAIT_FOR_TX_FIFO:
1197 case TRF7970A_ST_WAIT_FOR_RX_DATA:
1198 case TRF7970A_ST_WAIT_FOR_RX_DATA_CONT:
1199 case TRF7970A_ST_WAIT_TO_ISSUE_EOF:
1200 trf->aborting = true;
1201 break;
1202 default:
1203 break;
1204 }
1205
1195 mutex_unlock(&trf->lock); 1206 mutex_unlock(&trf->lock);
1196} 1207}
1197 1208