soc: tegra: fix tegra_pmc_get_suspend_mode definition
PATCH 1/1 soc: tegra: fix tegra_pmc_get_suspend_mode definition
When CONFIG_PM_SLEEP is disabled, the function is not defined, causing a link failure:
arm-linux-gnueabi-ld: drivers/cpuidle/cpuidle-tegra.o: in function `tegra_cpuidle_probe':
cpuidle-tegra.c:(.text+0x24): undefined reference to `tegra_pmc_get_suspend_mode'
Change the #ifdef check according to the definition.
--- include/soc/tegra/pmc.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
include/soc/tegra/pmc.h +9 -6
@@ -168,7 +168,6 @@ int tegra_io_pad_power_disable(enum tegra_io_pad id);int tegra_io_rail_power_on (unsigned int id);int tegra_io_rail_power_off (unsigned int id); -enum tegra_suspend_mode tegra_pmc_get_suspend_mode (void );void tegra_pmc_set_suspend_mode (enum tegra_suspend_mode mode);void tegra_pmc_enter_suspend_mode (enum tegra_suspend_mode mode);
@@ -220,11 +219,6 @@ static inline int tegra_io_rail_power_off(unsigned int id)return -ENOSYS ; } -static inline enum tegra_suspend_mode tegra_pmc_get_suspend_mode (void ) -{ -return TEGRA_SUSPEND_NONE ; -} -static inline void tegra_pmc_set_suspend_mode (enum tegra_suspend_mode mode) { }
@@ -235,4 +229,13 @@ static inline void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode)#endif /* CONFIG_SOC_TEGRA_PMC */ +#if defined(CONFIG_SOC_TEGRA_PMC ) && defined(CONFIG_PM_SLEEP ) +enum tegra_suspend_mode tegra_pmc_get_suspend_mode (void ); +#else +static inline enum tegra_suspend_mode tegra_pmc_get_suspend_mode (void ) +{ +return TEGRA_SUSPEND_NONE ; +} +#endif +#endif /* __SOC_TEGRA_PMC_H__ */
Signature · 1 line
2.26.0
08.04.2020 22:01, Arnd Bergmann пишет:
Quoted 11 lines
When
CONFIG_PM_SLEEPis disabled, the function is not defined, causing a link failure:arm-linux-gnueabi-ld:
drivers/cpuidle/cpuidle-tegra.o: in function `tegra_cpuidle_probe':
cpuidle-tegra.c:(.text+0x24): undefined reference to `tegra_pmc_get_suspend_mode'Change the #ifdef check according to the definition.
Fixes 382ac8e22b90 ("cpuidle: tegra: Disable CC6 state if LP2 unavailable")Signed-off-by Arnd Bergmann <[email protected]>---
Quoted 6 lines · Arnd Bergmann
When
CONFIG_PM_SLEEPis disabled, the function is not defined, causing a link failure:arm-linux-gnueabi-ld:
drivers/cpuidle/cpuidle-tegra.o: in function `tegra_cpuidle_probe':
cpuidle-tegra.c:(.text+0x24): undefined reference to `tegra_pmc_get_suspend_mode'
Quoted 7 lines
Change the #ifdef check according to the definition.
Fixes 382ac8e22b90 ("cpuidle: tegra: Disable CC6 state if LP2 unavailable")Signed-off-by Arnd Bergmann <[email protected]>--- include/soc/tegra/pmc.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
Let me know if you'd prefer me to send this in a pull request later on.
Thanks,
Thierry