sparc: move is_root_node from private header to of.h
Subsystems (2)
PATCH 1/1 sparc: move is_root_node from private header to of.h
Make is_root_node available for all archs to use, as it's not PROM-specific. Also rename it to of_is_root_node, and a few other minor changes for style/consistency.
--- arch/sparc/kernel/prom.h | 8 -------- arch/sparc/kernel/prom_64.c | 6 +++--- arch/sparc/kernel/prom_common.c | 2 +- include/linux/of.h | 8 ++++++++ 4 files changed, 12 insertions(+), 12 deletions(-)
arch/sparc/kernel/prom.h +0 -8
@@ -9,14 +9,6 @@ extern void irq_trans_init(struct device_node *dp);extern unsigned int prom_unique_id; -static inline int is_root_node (const struct device_node *dp) -{ -if (!dp) -return 0 ; - -return (dp->parent ==NULL ); -} -extern char *build_path_component (struct device_node *dp);extern void of_console_init (void );
arch/sparc/kernel/prom_64.c +3 -3
@@ -21,7 +21,7 @@#include <linux/mm.h> #include <linux/module.h> #include <linux/lmb.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <asm/prom.h> #include <asm/oplib.h>
@@ -81,7 +81,7 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)return ; regs = rprop->value; -if (!is_root_node (dp->parent)) { +if (!of_is_root_node (dp->parent)) { sprintf(tmp_buf, "%s@%x,%x", dp->name, (unsigned int) (regs->phys_addr >> 32UL),
@@ -121,7 +121,7 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)return ; regs = prop->value; -if (!is_root_node (dp->parent)) { +if (!of_is_root_node (dp->parent)) { sprintf(tmp_buf, "%s@%x,%x", dp->name, (unsigned int) (regs->phys_addr >> 32UL),
arch/sparc/kernel/prom_common.c +1 -1
@@ -244,7 +244,7 @@ char * __init build_full_name(struct device_node *dp) n =prom_early_alloc (len);strcpy (n, dp->parent->full_name); -if (!is_root_node (dp->parent)) { +if (!of_is_root_node (dp->parent)) {strcpy (n + plen,"/" ); plen++; }
include/linux/of.h +8 -0
@@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct device_node *node);extern void of_node_put (struct device_node *node);#endif +static inline bool of_is_root_node (const struct device_node *node) +{ +if (!node) +return false; + +return (node->parent ==NULL ); +} +/* * OF address retreival & translation */
Signature · 1 line
1.5.6.5
Quoted 12 lines · Andres Salomon
Make
is_root_nodeavailable for all archs to use, as it's not PROM-specific. Also rename it toof_is_root_node, and a few other minor changes for style/consistency.Signed-off-by Andres Salomon <[email protected]>---
arch/sparc/kernel/prom.h | 8 --------
arch/sparc/kernel/prom_64.c | 6 +++---
arch/sparc/kernel/prom_common.c | 2 +-
include/linux/of.h | 8 ++++++++4 files changed, 12 insertions(+), 12 deletions(-)
[...]
Quoted 5 lines
include/linux/of.h +0
-0
include/linux/of.h extern struct device_node *of_node_get(struct device_node *node); · line 106
Quoted 10 lines
include/linux/of.h +7
-0@@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct device_node *node); extern void of_node_put(struct device_node *node); #endif +static inline bool of_is_root_node (const struct device_node *node) +{ + if (!node) + return false; + + return (node->parent == NULL); +}
Are you okay if I shorten this to?
+static inline bool of_is_root_node(const struct device_node *node) +{
+ return (node && (node->parent == NULL));
+}
g.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 38 lines · On Mon, 12 Jul 2010 09:53:04 -0600 Grant Likely <[email protected]>…
Quoted 12 lines · Andres Salomon
Make
is_root_nodeavailable for all archs to use, as it's not PROM-specific. Also rename it toof_is_root_node, and a few other minor changes for style/consistency.Signed-off-by Andres Salomon <[email protected]>---
arch/sparc/kernel/prom.h | 8 --------
arch/sparc/kernel/prom_64.c | 6 +++---
arch/sparc/kernel/prom_common.c | 2 +-
include/linux/of.h | 8 ++++++++4 files changed, 12 insertions(+), 12 deletions(-)[...]
Quoted 8 lines
include/linux/of.h +0
-0@@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct
device_node*node); extern voidof_node_put(struct device_node *node); #endifinclude/linux/of.h extern struct device_node *of_node_get(struct device_node *node); · line 106
Quoted 7 lines
include/linux/of.h +7
-0+static inline bool of_is_root_node (const struct device_node *node) +{ + if (!node) + return false; + + return (node->parent == NULL); +}Are you okay if I shorten this to?
include/linux/of.h +4
-0+static inline bool of_is_root_node (const struct device_node *node) +{ +return (node && (node->parent ==NULL )); +}
Quoted 1 line
g.
It's fine with me.
From: Andres Salomon <[email protected]>
Date: Tue, 13 Jul 2010 20:05:41 +0000
Quoted 36 lines
Quoted 33 lines · On Mon, 12 Jul 2010 09:53:04 -0600 Grant Likely <[email protected]>…
Quoted 12 lines · Andres Salomon
Make
is_root_nodeavailable for all archs to use, as it's not PROM-specific. Also rename it toof_is_root_node, and a few other minor changes for style/consistency.Signed-off-by Andres Salomon <[email protected]>---
arch/sparc/kernel/prom.h | 8 --------
arch/sparc/kernel/prom_64.c | 6 +++---
arch/sparc/kernel/prom_common.c | 2 +-
include/linux/of.h | 8 ++++++++4 files changed, 12 insertions(+), 12 deletions(-)[...]
Quoted 8 lines
include/linux/of.h +0
-0@@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct
device_node*node); extern voidof_node_put(struct device_node *node); #endifinclude/linux/of.h extern struct device_node *of_node_get(struct device_node *node); · line 106
Quoted 7 lines
include/linux/of.h +7
-0+static inline bool of_is_root_node (const struct device_node *node) +{ + if (!node) + return false; + + return (node->parent == NULL); +}Are you okay if I shorten this to?
Quoted 9 lines
Quoted 6 lines
include/linux/of.h +4
-0+static inline bool of_is_root_node (const struct device_node *node) +{ +return (node && (node->parent ==NULL )); +}g.
It's fine with me.
Me too:
A message that is not in the archive (sent off-list or not yet received): AANLkTinVpBjQQa93DZ17ULQdspDByGV8h037bVJ2qxGC-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 38 lines · On Mon, 12 Jul 2010 09:53:04 -0600 Grant Likely…
Quoted 12 lines · Andres Salomon
Make
is_root_nodeavailable for all archs to use, as it's not PROM-specific. Also rename it toof_is_root_node, and a few other minor changes for style/consistency.Signed-off-by Andres Salomon <[email protected]>---
arch/sparc/kernel/prom.h | 8 --------
arch/sparc/kernel/prom_64.c | 6 +++---
arch/sparc/kernel/prom_common.c | 2 +-
include/linux/of.h | 8 ++++++++4 files changed, 12 insertions(+), 12 deletions(-)[...]
Quoted 8 lines
include/linux/of.h +0
-0@@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct
device_node*node); extern voidof_node_put(struct device_node *node); #endifinclude/linux/of.h extern struct device_node *of_node_get(struct device_node *node); · line 106
Quoted 7 lines
include/linux/of.h +7
-0+static inline bool of_is_root_node (const struct device_node *node) +{ + if (!node) + return false; + + return (node->parent == NULL); +}Are you okay if I shorten this to?
include/linux/of.h +4
-0+static inline bool of_is_root_node (const struct device_node *node) +{ +return (node && (node->parent ==NULL )); +}
Quoted 1 line
g.
It's fine with me.
Quoted 38 lines · On Mon, 12 Jul 2010 09:53:04 -0600 Grant Likely <[email protected]>…
Quoted 12 lines · Andres Salomon
Make
is_root_nodeavailable for all archs to use, as it's not PROM-specific. Also rename it toof_is_root_node, and a few other minor changes for style/consistency.Signed-off-by Andres Salomon <[email protected]>---
arch/sparc/kernel/prom.h | 8 --------
arch/sparc/kernel/prom_64.c | 6 +++---
arch/sparc/kernel/prom_common.c | 2 +-
include/linux/of.h | 8 ++++++++4 files changed, 12 insertions(+), 12 deletions(-)[...]
Quoted 8 lines
include/linux/of.h +0
-0@@ -97,6 +97,14 @@ extern struct device_node *of_node_get(struct
device_node*node); extern voidof_node_put(struct device_node *node); #endifinclude/linux/of.h extern struct device_node *of_node_get(struct device_node *node); · line 106
Quoted 7 lines
include/linux/of.h +7
-0+static inline bool of_is_root_node (const struct device_node *node) +{ + if (!node) + return false; + + return (node->parent == NULL); +}Are you okay if I shorten this to?
include/linux/of.h +4
-0+static inline bool of_is_root_node (const struct device_node *node) +{ +return (node && (node->parent ==NULL )); +}
Quoted 1 line
g.
It's fine with me.