* [PATCH] NFC: trf7970a: Move trf7970a_init inside #ifdef CONFIG_PM_RUNTIME
@ 2014-06-16 13:06 Geert Uytterhoeven
[not found] ` <20140616155855.GA2539@animalcreek.com>
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2014-06-16 13:06 UTC (permalink / raw)
To: Mark A. Greer, Samuel Ortiz
Cc: linux-wireless, linux-nfc, linux-kernel, Geert Uytterhoeven
If CONFIG_PM_RUNTIME=n:
drivers/nfc/trf7970a.c:755: warning: ‘trf7970a_init’ defined but not used
Signed-off-by: Geert Uytterhoeven <geert@linux-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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [linux-nfc] [PATCH] NFC: trf7970a: Move trf7970a_init inside #ifdef CONFIG_PM_RUNTIME
[not found] ` <20140616155855.GA2539@animalcreek.com>
@ 2014-07-03 20:57 ` Mark A. Greer
0 siblings, 0 replies; 2+ messages in thread
From: Mark A. Greer @ 2014-07-03 20:57 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-wireless, linux-nfc, linux-kernel
On Mon, Jun 16, 2014 at 08:58:55AM -0700, Mark A. Greer wrote:
> On Mon, Jun 16, 2014 at 03:06:13PM +0200, Geert Uytterhoeven wrote:
> > If CONFIG_PM_RUNTIME=n:
> >
> > drivers/nfc/trf7970a.c:755: warning: ‘trf7970a_init’ defined but not used
> >
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> Acked-by: Mark A. Greer <mgreer@animalcreek.com>
Actually, I'd like to change my mind on this. I've modified the code
locally and I will have to move trf7970a_init() back to where it originally
was again, if this patch is taken. If you can tolerate the warning for
another week or so, I'll have a new set of patches that will fix it.
Not a big deal if you still want to take it.
Mark
--
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-03 21:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-16 13:06 [PATCH] NFC: trf7970a: Move trf7970a_init inside #ifdef CONFIG_PM_RUNTIME Geert Uytterhoeven
[not found] ` <20140616155855.GA2539@animalcreek.com>
2014-07-03 20:57 ` [linux-nfc] " Mark A. Greer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).