* [PATCH] spi: tegra20-slink: fix "defined but not used" if !CONFIG_PM
@ 2021-09-12 21:25 Adam Borowski
2021-09-13 11:12 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Adam Borowski @ 2021-09-12 21:25 UTC (permalink / raw)
To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter,
linux-spi, linux-tegra
Cc: Adam Borowski
Because of warnings, esp. with new default -Werror.
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
---
drivers/spi/spi-tegra20-slink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index ebd27f883033..c8b54c7c53d0 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -204,8 +204,10 @@ struct tegra_slink_data {
struct dma_async_tx_descriptor *tx_dma_desc;
};
+#ifdef CONFIG_PM
static int tegra_slink_runtime_suspend(struct device *dev);
static int tegra_slink_runtime_resume(struct device *dev);
+#endif
static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi,
unsigned long reg)
@@ -1185,6 +1187,7 @@ static int tegra_slink_resume(struct device *dev)
}
#endif
+#ifdef CONFIG_PM
static int tegra_slink_runtime_suspend(struct device *dev)
{
struct spi_master *master = dev_get_drvdata(dev);
@@ -1210,6 +1213,7 @@ static int tegra_slink_runtime_resume(struct device *dev)
}
return 0;
}
+#endif
static const struct dev_pm_ops slink_pm_ops = {
SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: tegra20-slink: fix "defined but not used" if !CONFIG_PM
2021-09-12 21:25 [PATCH] spi: tegra20-slink: fix "defined but not used" if !CONFIG_PM Adam Borowski
@ 2021-09-13 11:12 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-09-13 11:12 UTC (permalink / raw)
To: Adam Borowski
Cc: Laxman Dewangan, Thierry Reding, Jonathan Hunter, linux-spi, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
On Sun, Sep 12, 2021 at 11:25:19PM +0200, Adam Borowski wrote:
> +#ifdef CONFIG_PM
> static int tegra_slink_runtime_suspend(struct device *dev);
> static int tegra_slink_runtime_resume(struct device *dev);
> +#endif
ifdefs are not an idiomatic fix, use __maybe_unused if you have to.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-13 11:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 21:25 [PATCH] spi: tegra20-slink: fix "defined but not used" if !CONFIG_PM Adam Borowski
2021-09-13 11:12 ` Mark Brown
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).