Commit 12ef51b1 authored by Alain Volmat's avatar Alain Volmat Committed by Mark Brown

spi: stm32: avoid ifdef CONFIG_PM for pm callbacks

Avoid CONFIG_PM preprocessor check for pm suspend/resume
callbacks and identify the functions with __maybe_unused.
Signed-off-by: default avatarAlain Volmat <alain.volmat@foss.st.com>
Link: https://lore.kernel.org/r/1615545329-5496-1-git-send-email-alain.volmat@foss.st.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 31890269
...@@ -1976,8 +1976,7 @@ static int stm32_spi_remove(struct platform_device *pdev) ...@@ -1976,8 +1976,7 @@ static int stm32_spi_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused stm32_spi_runtime_suspend(struct device *dev)
static int stm32_spi_runtime_suspend(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct stm32_spi *spi = spi_master_get_devdata(master); struct stm32_spi *spi = spi_master_get_devdata(master);
...@@ -1987,7 +1986,7 @@ static int stm32_spi_runtime_suspend(struct device *dev) ...@@ -1987,7 +1986,7 @@ static int stm32_spi_runtime_suspend(struct device *dev)
return pinctrl_pm_select_sleep_state(dev); return pinctrl_pm_select_sleep_state(dev);
} }
static int stm32_spi_runtime_resume(struct device *dev) static int __maybe_unused stm32_spi_runtime_resume(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct stm32_spi *spi = spi_master_get_devdata(master); struct stm32_spi *spi = spi_master_get_devdata(master);
...@@ -1999,10 +1998,8 @@ static int stm32_spi_runtime_resume(struct device *dev) ...@@ -1999,10 +1998,8 @@ static int stm32_spi_runtime_resume(struct device *dev)
return clk_prepare_enable(spi->clk); return clk_prepare_enable(spi->clk);
} }
#endif
#ifdef CONFIG_PM_SLEEP static int __maybe_unused stm32_spi_suspend(struct device *dev)
static int stm32_spi_suspend(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
int ret; int ret;
...@@ -2014,7 +2011,7 @@ static int stm32_spi_suspend(struct device *dev) ...@@ -2014,7 +2011,7 @@ static int stm32_spi_suspend(struct device *dev)
return pm_runtime_force_suspend(dev); return pm_runtime_force_suspend(dev);
} }
static int stm32_spi_resume(struct device *dev) static int __maybe_unused stm32_spi_resume(struct device *dev)
{ {
struct spi_master *master = dev_get_drvdata(dev); struct spi_master *master = dev_get_drvdata(dev);
struct stm32_spi *spi = spi_master_get_devdata(master); struct stm32_spi *spi = spi_master_get_devdata(master);
...@@ -2044,7 +2041,6 @@ static int stm32_spi_resume(struct device *dev) ...@@ -2044,7 +2041,6 @@ static int stm32_spi_resume(struct device *dev)
return 0; return 0;
} }
#endif
static const struct dev_pm_ops stm32_spi_pm_ops = { static const struct dev_pm_ops stm32_spi_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(stm32_spi_suspend, stm32_spi_resume) SET_SYSTEM_SLEEP_PM_OPS(stm32_spi_suspend, stm32_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