提交 315527a9 编写于 作者: L Linus Torvalds 提交者: Zheng Zengkai

spi: Fix tegra20 build with CONFIG_PM=n

stable inclusion
from stable-5.10.70
commit db76cb05c0466362410d74c2559d521158030aff
bugzilla: 182949 https://gitee.com/openeuler/kernel/issues/I4I3GQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=db76cb05c0466362410d74c2559d521158030aff

--------------------------------

[ Upstream commit efafec27 ]

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: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 3090003a
...@@ -1201,7 +1201,7 @@ static int tegra_slink_resume(struct device *dev) ...@@ -1201,7 +1201,7 @@ static int tegra_slink_resume(struct device *dev)
} }
#endif #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 spi_master *master = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_master_get_devdata(master); struct tegra_slink_data *tspi = spi_master_get_devdata(master);
...@@ -1213,7 +1213,7 @@ static int tegra_slink_runtime_suspend(struct device *dev) ...@@ -1213,7 +1213,7 @@ static int tegra_slink_runtime_suspend(struct device *dev)
return 0; 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 spi_master *master = dev_get_drvdata(dev);
struct tegra_slink_data *tspi = spi_master_get_devdata(master); struct tegra_slink_data *tspi = spi_master_get_devdata(master);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册