Skip to content

Commit 5f35f78

Browse files
torvaldsgregkh
authored andcommitted
spi: Fix tegra20 build with CONFIG_PM=n
[ 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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9367a8f commit 5f35f78

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
@@ -1206,7 +1206,7 @@ static int tegra_slink_resume(struct device *dev)
12061206
}
12071207
#endif
12081208

1209-
static int tegra_slink_runtime_suspend(struct device *dev)
1209+
static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
12101210
{
12111211
struct spi_master *master = dev_get_drvdata(dev);
12121212
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
@@ -1218,7 +1218,7 @@ static int tegra_slink_runtime_suspend(struct device *dev)
12181218
return 0;
12191219
}
12201220

1221-
static int tegra_slink_runtime_resume(struct device *dev)
1221+
static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
12221222
{
12231223
struct spi_master *master = dev_get_drvdata(dev);
12241224
struct tegra_slink_data *tspi = spi_master_get_devdata(master);

0 commit comments

Comments
 (0)