[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1402923973-24316-1-git-send-email-geert@linux-m68k.org>
Date: Mon, 16 Jun 2014 15:06:13 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: "Mark A. Greer" <mgreer@...malcreek.com>,
Samuel Ortiz <sameo@...ux.intel.com>
Cc: linux-wireless@...r.kernel.org, linux-nfc@...ts.01.org,
linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: [PATCH] NFC: trf7970a: Move trf7970a_init inside #ifdef CONFIG_PM_RUNTIME
If CONFIG_PM_RUNTIME=n:
drivers/nfc/trf7970a.c:755: warning: ‘trf7970a_init’ defined but not used
Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
---
drivers/nfc/trf7970a.c | 80 +++++++++++++++++++++++++-------------------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 3b78b031e617..41a153ecc6ed 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -751,45 +751,6 @@ static void trf7970a_timeout_work_handler(struct work_struct *work)
mutex_unlock(&trf->lock);
}
-static int trf7970a_init(struct trf7970a *trf)
-{
- int ret;
-
- dev_dbg(trf->dev, "Initializing device - state: %d\n", trf->state);
-
- ret = trf7970a_cmd(trf, TRF7970A_CMD_SOFT_INIT);
- if (ret)
- goto err_out;
-
- ret = trf7970a_cmd(trf, TRF7970A_CMD_IDLE);
- if (ret)
- goto err_out;
-
- /* Must clear NFC Target Detection Level reg due to erratum */
- ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL, 0);
- if (ret)
- goto err_out;
-
- ret = trf7970a_write(trf, TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS,
- TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96 |
- TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32);
- if (ret)
- goto err_out;
-
- ret = trf7970a_write(trf, TRF7970A_SPECIAL_FCN_REG1, 0);
- if (ret)
- goto err_out;
-
- trf->special_fcn_reg1 = 0;
-
- trf->iso_ctrl = 0xff;
- return 0;
-
-err_out:
- dev_dbg(trf->dev, "Couldn't init device: %d\n", ret);
- return ret;
-}
-
static void trf7970a_switch_rf_off(struct trf7970a *trf)
{
dev_dbg(trf->dev, "Switching rf off\n");
@@ -1430,6 +1391,45 @@ static int trf7970a_pm_runtime_suspend(struct device *dev)
return ret;
}
+static int trf7970a_init(struct trf7970a *trf)
+{
+ int ret;
+
+ dev_dbg(trf->dev, "Initializing device - state: %d\n", trf->state);
+
+ ret = trf7970a_cmd(trf, TRF7970A_CMD_SOFT_INIT);
+ if (ret)
+ goto err_out;
+
+ ret = trf7970a_cmd(trf, TRF7970A_CMD_IDLE);
+ if (ret)
+ goto err_out;
+
+ /* Must clear NFC Target Detection Level reg due to erratum */
+ ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL, 0);
+ if (ret)
+ goto err_out;
+
+ ret = trf7970a_write(trf, TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS,
+ TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96 |
+ TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32);
+ if (ret)
+ goto err_out;
+
+ ret = trf7970a_write(trf, TRF7970A_SPECIAL_FCN_REG1, 0);
+ if (ret)
+ goto err_out;
+
+ trf->special_fcn_reg1 = 0;
+
+ trf->iso_ctrl = 0xff;
+ return 0;
+
+err_out:
+ dev_dbg(trf->dev, "Couldn't init device: %d\n", ret);
+ return ret;
+}
+
static int trf7970a_pm_runtime_resume(struct device *dev)
{
struct spi_device *spi = container_of(dev, struct spi_device, dev);
@@ -1462,7 +1462,7 @@ static int trf7970a_pm_runtime_resume(struct device *dev)
return 0;
}
-#endif
+#endif /* CONFIG_PM_RUNTIME */
static const struct dev_pm_ops trf7970a_pm_ops = {
SET_RUNTIME_PM_OPS(trf7970a_pm_runtime_suspend,
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists