aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-04-02 20:55:39 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-12 13:55:18 -0400
commit7a92f74f98bde8498c98aad6cac5da5a87dd0bf4 (patch)
tree2bae247e5aba6b256899f0a95df33a8a87235399
parent0e56efc7dcd1eb5004363e52bdbe801783245638 (diff)
[POWERPC] Rename device_is_compatible to of_device_is_compatible
This is more consistent and gets us closer to the Sparc code. We add a device_is_compatible define for compatibility during the change over. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/kernel/prom.c11
-rw-r--r--include/asm-powerpc/prom.h3
2 files changed, 8 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 622472818723..d2840b66c8c1 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1131,7 +1131,8 @@ EXPORT_SYMBOL(find_all_nodes);
1131/** Checks if the given "compat" string matches one of the strings in 1131/** Checks if the given "compat" string matches one of the strings in
1132 * the device's "compatible" property 1132 * the device's "compatible" property
1133 */ 1133 */
1134int device_is_compatible(const struct device_node *device, const char *compat) 1134int of_device_is_compatible(const struct device_node *device,
1135 const char *compat)
1135{ 1136{
1136 const char* cp; 1137 const char* cp;
1137 int cplen, l; 1138 int cplen, l;
@@ -1149,7 +1150,7 @@ int device_is_compatible(const struct device_node *device, const char *compat)
1149 1150
1150 return 0; 1151 return 0;
1151} 1152}
1152EXPORT_SYMBOL(device_is_compatible); 1153EXPORT_SYMBOL(of_device_is_compatible);
1153 1154
1154 1155
1155/** 1156/**
@@ -1163,7 +1164,7 @@ int machine_is_compatible(const char *compat)
1163 1164
1164 root = of_find_node_by_path("/"); 1165 root = of_find_node_by_path("/");
1165 if (root) { 1166 if (root) {
1166 rc = device_is_compatible(root, compat); 1167 rc = of_device_is_compatible(root, compat);
1167 of_node_put(root); 1168 of_node_put(root);
1168 } 1169 }
1169 return rc; 1170 return rc;
@@ -1184,7 +1185,7 @@ struct device_node *find_compatible_devices(const char *type,
1184 if (type != NULL 1185 if (type != NULL
1185 && !(np->type != 0 && strcasecmp(np->type, type) == 0)) 1186 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
1186 continue; 1187 continue;
1187 if (device_is_compatible(np, compat)) { 1188 if (of_device_is_compatible(np, compat)) {
1188 *prevp = np; 1189 *prevp = np;
1189 prevp = &np->next; 1190 prevp = &np->next;
1190 } 1191 }
@@ -1300,7 +1301,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
1300 if (type != NULL 1301 if (type != NULL
1301 && !(np->type != 0 && strcasecmp(np->type, type) == 0)) 1302 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
1302 continue; 1303 continue;
1303 if (device_is_compatible(np, compatible) && of_node_get(np)) 1304 if (of_device_is_compatible(np, compatible) && of_node_get(np))
1304 break; 1305 break;
1305 } 1306 }
1306 of_node_put(from); 1307 of_node_put(from);
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 448c5ce76fbe..fcacc88b7706 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -162,8 +162,9 @@ extern void of_detach_node(const struct device_node *);
162extern void finish_device_tree(void); 162extern void finish_device_tree(void);
163extern void unflatten_device_tree(void); 163extern void unflatten_device_tree(void);
164extern void early_init_devtree(void *); 164extern void early_init_devtree(void *);
165extern int device_is_compatible(const struct device_node *device, 165extern int of_device_is_compatible(const struct device_node *device,
166 const char *); 166 const char *);
167#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
167extern int machine_is_compatible(const char *compat); 168extern int machine_is_compatible(const char *compat);
168extern const void *of_get_property(const struct device_node *node, 169extern const void *of_get_property(const struct device_node *node,
169 const char *name, 170 const char *name,