diff mbox series

soc: tegra: fix tegra_pmc_get_suspend_mode definition

Message ID 20200408190127.587768-1-arnd@arndb.de (mailing list archive)
State Mainlined
Commit b1018eb75c98a2703a38f6d85ea6bd3bcc5f5238
Headers show
Series soc: tegra: fix tegra_pmc_get_suspend_mode definition | expand

Commit Message

Arnd Bergmann April 8, 2020, 7:01 p.m. UTC
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: 382ac8e22b90 ("cpuidle: tegra: Disable CC6 state if LP2 unavailable")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/soc/tegra/pmc.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Comments

Dmitry Osipenko April 8, 2020, 8:56 p.m. UTC | #1
08.04.2020 22:01, Arnd Bergmann пишет:
> 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: 382ac8e22b90 ("cpuidle: tegra: Disable CC6 state if LP2 unavailable")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Thierry Reding April 9, 2020, 3:02 p.m. UTC | #2
On Wed, Apr 08, 2020 at 09:01:15PM +0200, Arnd Bergmann wrote:
> 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: 382ac8e22b90 ("cpuidle: tegra: Disable CC6 state if LP2 unavailable")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  include/soc/tegra/pmc.h | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)

Acked-by: Thierry Reding <treding@nvidia.com>

Let me know if you'd prefer me to send this in a pull request later on.

Thanks,
Thierry
patchwork-bot+linux-soc@kernel.org April 17, 2020, 3:12 p.m. UTC | #3
Hello:

This patch was applied to soc/soc.git (refs/heads/for-next).

On Wed,  8 Apr 2020 21:01:15 +0200 you wrote:
> 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.
> 
> [...]


Here is a summary with links:
  - soc: tegra: fix tegra_pmc_get_suspend_mode definition
    https://git.kernel.org/soc/soc/c/d07035da2a01402ac78eb2a5baca047dc2777989

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/soc/tegra/pmc.h b/include/soc/tegra/pmc.h
index 0dd52b0a5c1b..361cb64246f7 100644
--- a/include/soc/tegra/pmc.h
+++ b/include/soc/tegra/pmc.h
@@ -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__ */