From 795e92ec5fd79027648bd7f779d34bad5b6f2f55 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 6 Oct 2021 11:43:21 -0500 Subject: of: Add of_get_cpu_hwid() to read hardware ID from CPU nodes There are various open coded implementions parsing the CPU node 'reg' property which contains the CPU's hardware ID. Introduce a new function, of_get_cpu_hwid(), to read the hardware ID. All the callers should be DT only code, so no need for an empty function. Cc: Frank Rowand Signed-off-by: Rob Herring Tested-by: Florian Fainelli Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/20211006164332.1981454-2-robh@kernel.org --- include/linux/of.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/of.h b/include/linux/of.h index 6f1c41f109bb..807f8168dad9 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -353,6 +353,7 @@ extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); extern struct device_node *of_get_next_cpu_node(struct device_node *prev); extern struct device_node *of_get_cpu_state_node(struct device_node *cpu_node, int index); +extern u64 of_get_cpu_hwid(struct device_node *cpun, unsigned int thread); #define for_each_property_of_node(dn, pp) \ for (pp = dn->properties; pp != NULL; pp = pp->next) -- cgit v1.2.3 From a3c85b2ee098c4a293148fab4eb96299e92b9524 Mon Sep 17 00:00:00 2001 From: Nathan Lynch Date: Thu, 14 Oct 2021 12:30:55 -0500 Subject: of: make of_node_check_flag() device_node parameter const The device_node argument isn't modified by of_node_check_flag(), so mark it const. Signed-off-by: Nathan Lynch Link: https://lore.kernel.org/r/20211014173055.2117872-1-nathanl@linux.ibm.com Signed-off-by: Rob Herring --- include/linux/of.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/of.h b/include/linux/of.h index 807f8168dad9..ff143a027abc 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -185,7 +185,7 @@ static inline bool of_node_is_root(const struct device_node *node) return node && (node->parent == NULL); } -static inline int of_node_check_flag(struct device_node *n, unsigned long flag) +static inline int of_node_check_flag(const struct device_node *n, unsigned long flag) { return test_bit(flag, &n->_flags); } -- cgit v1.2.3