Skip to content

Commit

Permalink
NFC: trf7970a: Unlock mutex before exiting _trf7970a_tg_listen()
Browse files Browse the repository at this point in the history
The recently added _trf7970a_tg_listen() routine
has some return paths that don't unlock the mutex
that is locked when the routine is entered.  Fix
this by always unlocking the mutex before returning.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Mark A. Greer authored and Samuel Ortiz committed Sep 23, 2014
1 parent b9e3016 commit fc0ae24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/nfc/trf7970a.c
Original file line number Diff line number Diff line change
Expand Up @@ -1728,22 +1728,22 @@ static int _trf7970a_tg_listen(struct nfc_digital_dev *ddev, u16 timeout,
TRF7970A_RX_SPECIAL_SETTINGS_C424 |
TRF7970A_RX_SPECIAL_SETTINGS_C212);
if (ret)
return ret;
goto out_err;

ret = trf7970a_write(trf, TRF7970A_REG_IO_CTRL,
TRF7970A_REG_IO_CTRL_VRS(0x1));
if (ret)
return ret;
goto out_err;

ret = trf7970a_write(trf, TRF7970A_NFC_LOW_FIELD_LEVEL,
TRF7970A_NFC_LOW_FIELD_LEVEL_RFDET(0x3));
if (ret)
return ret;
goto out_err;

ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL,
TRF7970A_NFC_TARGET_LEVEL_RFDET(0x7));
if (ret)
return ret;
goto out_err;

trf->ddev = ddev;
trf->cb = cb;
Expand Down

0 comments on commit fc0ae24

Please sign in to comment.