Commit d630526d authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Mark Brown

spi: atmel: remove warning when !CONFIG_PM_SLEEP

When CONFIG_PM is defined but not CONFIG_PM_SLEEP (this happens when
CONFIG_SUSPEND is not defined), there is the following warning:

drivers/spi/spi-atmel.c:1723:12: warning: ‘atmel_spi_suspend’ defined but not used [-Wunused-function]
drivers/spi/spi-atmel.c:1741:12: warning: ‘atmel_spi_resume’ defined but not used [-Wunused-function]

Enclose both atmel_spi_suspend and atmel_spi_resume in #ifdef
CONFIG_PM_SLEEP/#endif to solve that.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d770e558
...@@ -1721,6 +1721,7 @@ static int atmel_spi_runtime_resume(struct device *dev) ...@@ -1721,6 +1721,7 @@ static int atmel_spi_runtime_resume(struct device *dev)
return clk_prepare_enable(as->clk); return clk_prepare_enable(as->clk);
} }
#ifdef CONFIG_PM_SLEEP
static int atmel_spi_suspend(struct device *dev) static int atmel_spi_suspend(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
...@@ -1757,6 +1758,7 @@ static int atmel_spi_resume(struct device *dev) ...@@ -1757,6 +1758,7 @@ static int atmel_spi_resume(struct device *dev)
return ret; return ret;
} }
#endif
static const struct dev_pm_ops atmel_spi_pm_ops = { static const struct dev_pm_ops atmel_spi_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume) SET_SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment