Skip to content

Commit efafec2

Browse files
committed
spi: Fix tegra20 build with CONFIG_PM=n
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>
1 parent 4357f03 commit efafec2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-tegra20-slink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ static int tegra_slink_resume(struct device *dev)
11851185
}
11861186
#endif
11871187

1188-
static int tegra_slink_runtime_suspend(struct device *dev)
1188+
static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
11891189
{
11901190
struct spi_master *master = dev_get_drvdata(dev);
11911191
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
@@ -1197,7 +1197,7 @@ static int tegra_slink_runtime_suspend(struct device *dev)
11971197
return 0;
11981198
}
11991199

1200-
static int tegra_slink_runtime_resume(struct device *dev)
1200+
static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
12011201
{
12021202
struct spi_master *master = dev_get_drvdata(dev);
12031203
struct tegra_slink_data *tspi = spi_master_get_devdata(master);

0 commit comments

Comments
 (0)