linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arc: kernel: use exporting symbol instead of static inline for arc_get_core_freq()
@ 2013-10-28  3:32 Chen Gang
  2013-10-28  6:15 ` Chen Gang
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2013-10-28  3:32 UTC (permalink / raw)
  To: vgupta, noamc; +Cc: linux-kernel

Need export arc_get_core_freq() instead of let it static inline, or if
other individual modules use it (e.g. use BASE_BAUD), it can not find
core_freq variable.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 arch/arc/include/asm/clk.h |    9 +--------
 arch/arc/kernel/clk.c      |    9 ++++++++-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arc/include/asm/clk.h b/arch/arc/include/asm/clk.h
index bf9d29f..256321a 100644
--- a/arch/arc/include/asm/clk.h
+++ b/arch/arc/include/asm/clk.h
@@ -9,14 +9,7 @@
 #ifndef _ASM_ARC_CLK_H
 #define _ASM_ARC_CLK_H
 
-/* Although we can't really hide core_freq, the accessor is still better way */
-extern unsigned long core_freq;
-
-static inline unsigned long arc_get_core_freq(void)
-{
-	return core_freq;
-}
-
+extern unsigned long arc_get_core_freq(void);
 extern int arc_set_core_freq(unsigned long);
 
 #endif
diff --git a/arch/arc/kernel/clk.c b/arch/arc/kernel/clk.c
index 10c7b0b..9f4602f 100644
--- a/arch/arc/kernel/clk.c
+++ b/arch/arc/kernel/clk.c
@@ -6,9 +6,16 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/module.h>
 #include <asm/clk.h>
 
-unsigned long core_freq = 80000000;
+static unsigned long core_freq = 80000000;
+
+unsigned long arc_get_core_freq(void)
+{
+	return core_freq;
+}
+EXPORT_SYMBOL_GPL(arc_get_core_freq);
 
 /*
  * As of now we default to device-tree provided clock
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arc: kernel: use exporting symbol instead of static inline for arc_get_core_freq()
  2013-10-28  3:32 [PATCH] arc: kernel: use exporting symbol instead of static inline for arc_get_core_freq() Chen Gang
@ 2013-10-28  6:15 ` Chen Gang
  2013-10-28  6:18   ` [PATCH v2] " Chen Gang
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2013-10-28  6:15 UTC (permalink / raw)
  To: vgupta, noamc; +Cc: linux-kernel

On 10/28/2013 11:32 AM, Chen Gang wrote:
> Need export arc_get_core_freq() instead of let it static inline, or if
> other individual modules use it (e.g. use BASE_BAUD), it can not find
> core_freq variable.
> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  arch/arc/include/asm/clk.h |    9 +--------
>  arch/arc/kernel/clk.c      |    9 ++++++++-
>  2 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arc/include/asm/clk.h b/arch/arc/include/asm/clk.h
> index bf9d29f..256321a 100644
> --- a/arch/arc/include/asm/clk.h
> +++ b/arch/arc/include/asm/clk.h
> @@ -9,14 +9,7 @@
>  #ifndef _ASM_ARC_CLK_H
>  #define _ASM_ARC_CLK_H
>  
> -/* Although we can't really hide core_freq, the accessor is still better way */
> -extern unsigned long core_freq;
> -
> -static inline unsigned long arc_get_core_freq(void)
> -{
> -	return core_freq;
> -}
> -
> +extern unsigned long arc_get_core_freq(void);
>  extern int arc_set_core_freq(unsigned long);
>  
>  #endif
> diff --git a/arch/arc/kernel/clk.c b/arch/arc/kernel/clk.c
> index 10c7b0b..9f4602f 100644
> --- a/arch/arc/kernel/clk.c
> +++ b/arch/arc/kernel/clk.c
> @@ -6,9 +6,16 @@
>   * published by the Free Software Foundation.
>   */
>  
> +#include <linux/module.h>
>  #include <asm/clk.h>
>  
> -unsigned long core_freq = 80000000;
> +static unsigned long core_freq = 80000000;
> +
> +unsigned long arc_get_core_freq(void)
> +{
> +	return core_freq;
> +}
> +EXPORT_SYMBOL_GPL(arc_get_core_freq);
>

Oh, sorry, need use EXPORT_SYMBOL instead of EXPORT_SYMBOL_GPL for it. I
will send patch v2.


>  /*
>   * As of now we default to device-tree provided clock
> 


-- 
Chen Gang

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] arc: kernel: use exporting symbol instead of static inline for arc_get_core_freq()
  2013-10-28  6:15 ` Chen Gang
@ 2013-10-28  6:18   ` Chen Gang
  0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2013-10-28  6:18 UTC (permalink / raw)
  To: vgupta, noamc; +Cc: linux-kernel

Need export arc_get_core_freq() instead of let it static inline, or if
other individual modules use it (e.g. use BASE_BAUD), it can not find
core_freq variable.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 arch/arc/include/asm/clk.h |    9 +--------
 arch/arc/kernel/clk.c      |    9 ++++++++-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arc/include/asm/clk.h b/arch/arc/include/asm/clk.h
index bf9d29f..256321a 100644
--- a/arch/arc/include/asm/clk.h
+++ b/arch/arc/include/asm/clk.h
@@ -9,14 +9,7 @@
 #ifndef _ASM_ARC_CLK_H
 #define _ASM_ARC_CLK_H
 
-/* Although we can't really hide core_freq, the accessor is still better way */
-extern unsigned long core_freq;
-
-static inline unsigned long arc_get_core_freq(void)
-{
-	return core_freq;
-}
-
+extern unsigned long arc_get_core_freq(void);
 extern int arc_set_core_freq(unsigned long);
 
 #endif
diff --git a/arch/arc/kernel/clk.c b/arch/arc/kernel/clk.c
index 10c7b0b..798be4a 100644
--- a/arch/arc/kernel/clk.c
+++ b/arch/arc/kernel/clk.c
@@ -6,9 +6,16 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/module.h>
 #include <asm/clk.h>
 
-unsigned long core_freq = 80000000;
+static unsigned long core_freq = 80000000;
+
+unsigned long arc_get_core_freq(void)
+{
+	return core_freq;
+}
+EXPORT_SYMBOL(arc_get_core_freq);
 
 /*
  * As of now we default to device-tree provided clock
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-28  6:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-28  3:32 [PATCH] arc: kernel: use exporting symbol instead of static inline for arc_get_core_freq() Chen Gang
2013-10-28  6:15 ` Chen Gang
2013-10-28  6:18   ` [PATCH v2] " Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).