summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/prom.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 01:33:54 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-24 08:15:04 +0200
commitaaf7cec2769942035985716452107fc5ba0b11f6 (patch)
tree4f4bc5278ef41e016b97b6860d30fa773db7fee2 /arch/sparc64/kernel/prom.c
parent[SPARC64]: Import OBP device tree into kernel data structures. (diff)
downloadlinux-aaf7cec2769942035985716452107fc5ba0b11f6.tar.xz
linux-aaf7cec2769942035985716452107fc5ba0b11f6.zip
[SPARC64]: Add of_find_node_by_{name,type}().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/prom.c')
-rw-r--r--arch/sparc64/kernel/prom.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index c99b7aae19df..fd46e94ce06b 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -63,6 +63,32 @@ struct device_node *of_find_node_by_path(const char *path)
return np;
}
+struct device_node *of_find_node_by_name(struct device_node *from,
+ const char *name)
+{
+ struct device_node *np;
+
+ np = from ? from->allnext : allnodes;
+ for (; np != NULL; np = np->allnext)
+ if (np->name != NULL && strcmp(np->name, name) == 0)
+ break;
+
+ return np;
+}
+
+struct device_node *of_find_node_by_type(struct device_node *from,
+ const char *type)
+{
+ struct device_node *np;
+
+ np = from ? from->allnext : allnodes;
+ for (; np != 0; np = np->allnext)
+ if (np->type != 0 && strcmp(np->type, type) == 0)
+ break;
+
+ return np;
+}
+
struct property *of_find_property(struct device_node *np, const char *name,
int *lenp)
{