Skip to content

Commit

Permalink
spi: Fix tegra20 build with CONFIG_PM=n
Browse files Browse the repository at this point in the history
[ Upstream commit efafec2 ]

Without CONFIG_PM enabled, the SET_RUNTIME_PM_OPS() macro ends up being
empty, and the only use of tegra_slink_runtime_{resume,suspend} goes
away, resulting in

  drivers/spi/spi-tegra20-slink.c:1200:12: error: ‘tegra_slink_runtime_resume’ defined but not used [-Werror=unused-function]
   1200 | static int tegra_slink_runtime_resume(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/spi/spi-tegra20-slink.c:1188:12: error: ‘tegra_slink_runtime_suspend’ defined but not used [-Werror=unused-function]
   1188 | static int tegra_slink_runtime_suspend(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~

mark the functions __maybe_unused to make the build happy.

This hits the alpha allmodconfig build (and others).

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
torvalds authored and gregkh committed Sep 30, 2021
1 parent 9367a8f commit 5f35f78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-tegra20-slink.c
Expand Up @@ -1206,7 +1206,7 @@ static int tegra_slink_resume(struct device *dev)
}
#endif

static int tegra_slink_runtime_suspend(struct device *dev)
static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
{
struct spi_master *master = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
Expand All @@ -1218,7 +1218,7 @@ static int tegra_slink_runtime_suspend(struct device *dev)
return 0;
}

static int tegra_slink_runtime_resume(struct device *dev)
static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
{
struct spi_master *master = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
Expand Down

0 comments on commit 5f35f78

Please sign in to comment.