diff options
Diffstat (limited to 'drivers/nfc/st95hf/core.c')
-rw-r--r-- | drivers/nfc/st95hf/core.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 9642971e89ce..ed704bb77226 100644 --- a/drivers/nfc/st95hf/core.c +++ b/drivers/nfc/st95hf/core.c @@ -16,7 +16,6 @@ #include <linux/nfc.h> #include <linux/of_gpio.h> #include <linux/of.h> -#include <linux/of_irq.h> #include <linux/property.h> #include <linux/regulator/consumer.h> #include <linux/wait.h> @@ -926,10 +925,8 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, int len_data_to_tag = 0; skb_resp = nfc_alloc_recv_skb(MAX_RESPONSE_BUFFER_SIZE, GFP_KERNEL); - if (!skb_resp) { - rc = -ENOMEM; - goto error; - } + if (!skb_resp) + return -ENOMEM; switch (stcontext->current_rf_tech) { case NFC_DIGITAL_RF_TECH_106A: @@ -966,7 +963,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, rc = down_killable(&stcontext->exchange_lock); if (rc) { WARN(1, "Semaphore is not found up in st95hf_in_send_cmd\n"); - return rc; + goto free_skb_resp; } rc = st95hf_spi_send(&stcontext->spicontext, skb->data, @@ -986,7 +983,6 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, free_skb_resp: kfree_skb(skb_resp); -error: return rc; } @@ -1040,7 +1036,7 @@ static void st95hf_abort_cmd(struct nfc_digital_dev *ddev) { } -static struct nfc_digital_ops st95hf_nfc_digital_ops = { +static const struct nfc_digital_ops st95hf_nfc_digital_ops = { .in_configure_hw = st95hf_in_configure_hw, .in_send_cmd = st95hf_in_send_cmd, @@ -1059,9 +1055,9 @@ static const struct spi_device_id st95hf_id[] = { }; MODULE_DEVICE_TABLE(spi, st95hf_id); -static const struct of_device_id st95hf_spi_of_match[] = { - { .compatible = "st,st95hf" }, - { }, +static const struct of_device_id st95hf_spi_of_match[] __maybe_unused = { + { .compatible = "st,st95hf" }, + {}, }; MODULE_DEVICE_TABLE(of, st95hf_spi_of_match); @@ -1202,7 +1198,7 @@ err_disable_regulator: return ret; } -static int st95hf_remove(struct spi_device *nfc_spi_dev) +static void st95hf_remove(struct spi_device *nfc_spi_dev) { int result = 0; unsigned char reset_cmd = ST95HF_COMMAND_RESET; @@ -1230,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); @@ -1242,8 +1236,6 @@ static int st95hf_remove(struct spi_device *nfc_spi_dev) /* disable regulator */ if (stcontext->st95hf_supply) regulator_disable(stcontext->st95hf_supply); - - return result; } /* Register as SPI protocol driver */ |