diff options
author | Thierry Escande | 2016-06-16 20:24:42 +0200 |
---|---|---|
committer | Samuel Ortiz | 2016-07-06 10:08:57 +0200 |
commit | 3f89fea35fc37b326d6b3697fcc9cba235a60811 (patch) | |
tree | e891aafc234ba9d629ca382eaf913bae24473456 /net/nfc | |
parent | b77693447db987e77a39afaa8774e8702cb110d5 (diff) |
NFC: digital: Rework error handling in DEP_RES response
The Digital Protocol stack used to send a NACK frame whatever the error
type it receives in digital_in_recv_dep_res(). It actually should only
send a NACK frame on CRC or parity check errors or on any transmission
error if a NACK frame was previously sent. Existing drivers used to send
EIO error for this kind of issues so this patch limits sending of NACK
frames on EIO errors. All other errors will be reported to the upper
layers.
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/digital_dep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/nfc/digital_dep.c b/net/nfc/digital_dep.c index f72be7433df3..b62c85dc12a2 100644 --- a/net/nfc/digital_dep.c +++ b/net/nfc/digital_dep.c @@ -664,7 +664,7 @@ static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg, rc = PTR_ERR(resp); resp = NULL; - if (((rc != -ETIMEDOUT) || ddev->nack_count) && + if ((rc == -EIO || (rc == -ETIMEDOUT && ddev->nack_count)) && (ddev->nack_count++ < DIGITAL_NFC_DEP_N_RETRY_NACK)) { ddev->atn_count = 0; |