diff mbox series

[1/2] x86: cpu_x86: Make cpu_x86_get_count() non-static

Message ID 20200225121949.35950-2-wolfgang.wallner@br-automation.com
State Accepted
Commit fc35d7e1b1acc915111cff1ab73c24e56dba3a9d
Headers show
Series x86: apl: Add support for different number of cores | expand

Commit Message

Wolfgang Wallner Feb. 25, 2020, 12:19 p.m. UTC
The function cpu_x86_get_count() is also useful for other modules.
Make it non-static and add a prototype + description.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
---

 arch/x86/cpu/cpu_x86.c         |  2 +-
 arch/x86/include/asm/cpu_x86.h | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

Comments

Bin Meng Feb. 25, 2020, 1:15 p.m. UTC | #1
On Tue, Feb 25, 2020 at 8:19 PM Wolfgang Wallner
<wolfgang.wallner at br-automation.com> wrote:
>
> The function cpu_x86_get_count() is also useful for other modules.
> Make it non-static and add a prototype + description.
>
> Signed-off-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
> ---
>
>  arch/x86/cpu/cpu_x86.c         |  2 +-
>  arch/x86/include/asm/cpu_x86.h | 12 ++++++++++++
>  2 files changed, 13 insertions(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c
index 1aaf851bb4..3f2ba0881e 100644
--- a/arch/x86/cpu/cpu_x86.c
+++ b/arch/x86/cpu/cpu_x86.c
@@ -52,7 +52,7 @@  int cpu_x86_get_desc(struct udevice *dev, char *buf, int size)
 	return 0;
 }
 
-static int cpu_x86_get_count(struct udevice *dev)
+int cpu_x86_get_count(struct udevice *dev)
 {
 	int node, cpu;
 	int num = 0;
diff --git a/arch/x86/include/asm/cpu_x86.h b/arch/x86/include/asm/cpu_x86.h
index 19223f2c3b..ae8f4dcd5d 100644
--- a/arch/x86/include/asm/cpu_x86.h
+++ b/arch/x86/include/asm/cpu_x86.h
@@ -30,6 +30,18 @@  int cpu_x86_bind(struct udevice *dev);
  */
 int cpu_x86_get_desc(struct udevice *dev, char *buf, int size);
 
+/**
+ * cpu_x86_get_count() - Get the number of cores for an x86 CPU
+ *
+ * This function is suitable to use as the get_count() method for
+ * the CPU uclass.
+ *
+ * @dev:	Device to check (UCLASS_CPU)
+ * @return:	Number of cores if successful,
+ *		-ENOENT if not "/cpus" entry is found in the device tree
+ */
+int cpu_x86_get_count(struct udevice *dev);
+
 /**
  * cpu_x86_get_vendor() - Get a vendor string for an x86 CPU
  *