Skip to content

Commit e4cc4f5

Browse files
arndbthierryreding
authored andcommitted
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. Fixes: 382ac8e ("cpuidle: tegra: Disable CC6 state if LP2 unavailable") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 0970189 commit e4cc4f5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

include/soc/tegra/pmc.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ int tegra_io_pad_power_disable(enum tegra_io_pad id);
168168
int tegra_io_rail_power_on(unsigned int id);
169169
int tegra_io_rail_power_off(unsigned int id);
170170

171-
enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
172171
void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode);
173172
void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode);
174173

@@ -220,11 +219,6 @@ static inline int tegra_io_rail_power_off(unsigned int id)
220219
return -ENOSYS;
221220
}
222221

223-
static inline enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void)
224-
{
225-
return TEGRA_SUSPEND_NONE;
226-
}
227-
228222
static inline void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode)
229223
{
230224
}
@@ -235,4 +229,13 @@ static inline void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode)
235229

236230
#endif /* CONFIG_SOC_TEGRA_PMC */
237231

232+
#if defined(CONFIG_SOC_TEGRA_PMC) && defined(CONFIG_PM_SLEEP)
233+
enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
234+
#else
235+
static inline enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void)
236+
{
237+
return TEGRA_SUSPEND_NONE;
238+
}
239+
#endif
240+
238241
#endif /* __SOC_TEGRA_PMC_H__ */

0 commit comments

Comments
 (0)