Skip to content

Commit

Permalink
nfc: st95hf: Make spi remove() callback return zero
Browse files Browse the repository at this point in the history
If something goes wrong in the remove callback, returning an error code
just results in an error message. The device still disappears.

So don't skip disabling the regulator in st95hf_remove() if resetting
the controller via spi fails. Also don't return an error code which just
results in two error messages.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Uwe Kleine-König authored and David S. Miller committed Oct 20, 2021
1 parent 323e9a9 commit 641e3fd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/nfc/st95hf/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,11 +1226,9 @@ static int st95hf_remove(struct spi_device *nfc_spi_dev)
&reset_cmd,
ST95HF_RESET_CMD_LEN,
ASYNC);
if (result) {
if (result)
dev_err(&spictx->spidev->dev,
"ST95HF reset failed in remove() err = %d\n", result);
return result;
}

/* wait for 3 ms to complete the controller reset process */
usleep_range(3000, 4000);
Expand All @@ -1239,7 +1237,7 @@ static int st95hf_remove(struct spi_device *nfc_spi_dev)
if (stcontext->st95hf_supply)
regulator_disable(stcontext->st95hf_supply);

return result;
return 0;
}

/* Register as SPI protocol driver */
Expand Down

0 comments on commit 641e3fd

Please sign in to comment.