diff mbox series

[01/13] ARM: davinci: fix davinci_cpufreq_init() declaration

Message ID 20230516153109.514251-2-arnd@kernel.org (mailing list archive)
State Accepted
Commit 30955b4afc2bbea9046c60df994297fac5edc02c
Headers show
Series ARM: SoC: address -Wmissing-prototype warnings | expand

Commit Message

Arnd Bergmann May 16, 2023, 3:30 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The davinci_cpufreq_init() declaration is only seen by its caller
but not the definition:

drivers/cpufreq/davinci-cpufreq.c:153:12: error: no previous prototype for 'davinci_cpufreq_init'

Move it into the platform_data header that is already used an
interface between the two places.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-davinci/common.c                | 1 +
 arch/arm/mach-davinci/common.h                | 6 ------
 include/linux/platform_data/davinci-cpufreq.h | 6 ++++++
 3 files changed, 7 insertions(+), 6 deletions(-)

Comments

Bartosz Golaszewski May 16, 2023, 3:41 p.m. UTC | #1
On Tue, May 16, 2023 at 5:31 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The davinci_cpufreq_init() declaration is only seen by its caller
> but not the definition:
>
> drivers/cpufreq/davinci-cpufreq.c:153:12: error: no previous prototype for 'davinci_cpufreq_init'
>
> Move it into the platform_data header that is already used an
> interface between the two places.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/mach-davinci/common.c                | 1 +
>  arch/arm/mach-davinci/common.h                | 6 ------
>  include/linux/platform_data/davinci-cpufreq.h | 6 ++++++
>  3 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
> index c1ce6b2a8d48..7bc7018688de 100644
> --- a/arch/arm/mach-davinci/common.c
> +++ b/arch/arm/mach-davinci/common.c
> @@ -11,6 +11,7 @@
>  #include <linux/etherdevice.h>
>  #include <linux/davinci_emac.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/platform_data/davinci-cpufreq.h>
>
>  #include <asm/tlb.h>
>  #include <asm/mach/map.h>
> diff --git a/arch/arm/mach-davinci/common.h b/arch/arm/mach-davinci/common.h
> index b2a96cdf88da..010ba1df27b3 100644
> --- a/arch/arm/mach-davinci/common.h
> +++ b/arch/arm/mach-davinci/common.h
> @@ -55,12 +55,6 @@ extern void davinci_common_init(const struct davinci_soc_info *soc_info);
>  extern void davinci_init_ide(void);
>  void davinci_init_late(void);
>
> -#ifdef CONFIG_CPU_FREQ
> -int davinci_cpufreq_init(void);
> -#else
> -static inline int davinci_cpufreq_init(void) { return 0; }
> -#endif
> -
>  #ifdef CONFIG_SUSPEND
>  int davinci_pm_init(void);
>  #else
> diff --git a/include/linux/platform_data/davinci-cpufreq.h b/include/linux/platform_data/davinci-cpufreq.h
> index bc208c64e3d7..1ef91c36f609 100644
> --- a/include/linux/platform_data/davinci-cpufreq.h
> +++ b/include/linux/platform_data/davinci-cpufreq.h
> @@ -16,4 +16,10 @@ struct davinci_cpufreq_config {
>         int (*init)(void);
>  };
>
> +#ifdef CONFIG_CPU_FREQ
> +int davinci_cpufreq_init(void);
> +#else
> +static inline int davinci_cpufreq_init(void) { return 0; }
> +#endif
> +
>  #endif /* _MACH_DAVINCI_CPUFREQ_H */
> --
> 2.39.2
>

Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
diff mbox series

Patch

diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index c1ce6b2a8d48..7bc7018688de 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -11,6 +11,7 @@ 
 #include <linux/etherdevice.h>
 #include <linux/davinci_emac.h>
 #include <linux/dma-mapping.h>
+#include <linux/platform_data/davinci-cpufreq.h>
 
 #include <asm/tlb.h>
 #include <asm/mach/map.h>
diff --git a/arch/arm/mach-davinci/common.h b/arch/arm/mach-davinci/common.h
index b2a96cdf88da..010ba1df27b3 100644
--- a/arch/arm/mach-davinci/common.h
+++ b/arch/arm/mach-davinci/common.h
@@ -55,12 +55,6 @@  extern void davinci_common_init(const struct davinci_soc_info *soc_info);
 extern void davinci_init_ide(void);
 void davinci_init_late(void);
 
-#ifdef CONFIG_CPU_FREQ
-int davinci_cpufreq_init(void);
-#else
-static inline int davinci_cpufreq_init(void) { return 0; }
-#endif
-
 #ifdef CONFIG_SUSPEND
 int davinci_pm_init(void);
 #else
diff --git a/include/linux/platform_data/davinci-cpufreq.h b/include/linux/platform_data/davinci-cpufreq.h
index bc208c64e3d7..1ef91c36f609 100644
--- a/include/linux/platform_data/davinci-cpufreq.h
+++ b/include/linux/platform_data/davinci-cpufreq.h
@@ -16,4 +16,10 @@  struct davinci_cpufreq_config {
 	int (*init)(void);
 };
 
+#ifdef CONFIG_CPU_FREQ
+int davinci_cpufreq_init(void);
+#else
+static inline int davinci_cpufreq_init(void) { return 0; }
+#endif
+
 #endif /* _MACH_DAVINCI_CPUFREQ_H */