[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>
This commit is contained in:
parent
0e56efc7dc
commit
7a92f74f98
2 changed files with 8 additions and 6 deletions
|
@ -1131,7 +1131,8 @@ EXPORT_SYMBOL(find_all_nodes);
|
||||||
/** Checks if the given "compat" string matches one of the strings in
|
/** Checks if the given "compat" string matches one of the strings in
|
||||||
* the device's "compatible" property
|
* the device's "compatible" property
|
||||||
*/
|
*/
|
||||||
int device_is_compatible(const struct device_node *device, const char *compat)
|
int of_device_is_compatible(const struct device_node *device,
|
||||||
|
const char *compat)
|
||||||
{
|
{
|
||||||
const char* cp;
|
const char* cp;
|
||||||
int cplen, l;
|
int cplen, l;
|
||||||
|
@ -1149,7 +1150,7 @@ int device_is_compatible(const struct device_node *device, const char *compat)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(device_is_compatible);
|
EXPORT_SYMBOL(of_device_is_compatible);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1163,7 +1164,7 @@ int machine_is_compatible(const char *compat)
|
||||||
|
|
||||||
root = of_find_node_by_path("/");
|
root = of_find_node_by_path("/");
|
||||||
if (root) {
|
if (root) {
|
||||||
rc = device_is_compatible(root, compat);
|
rc = of_device_is_compatible(root, compat);
|
||||||
of_node_put(root);
|
of_node_put(root);
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -1184,7 +1185,7 @@ struct device_node *find_compatible_devices(const char *type,
|
||||||
if (type != NULL
|
if (type != NULL
|
||||||
&& !(np->type != 0 && strcasecmp(np->type, type) == 0))
|
&& !(np->type != 0 && strcasecmp(np->type, type) == 0))
|
||||||
continue;
|
continue;
|
||||||
if (device_is_compatible(np, compat)) {
|
if (of_device_is_compatible(np, compat)) {
|
||||||
*prevp = np;
|
*prevp = np;
|
||||||
prevp = &np->next;
|
prevp = &np->next;
|
||||||
}
|
}
|
||||||
|
@ -1300,7 +1301,7 @@ struct device_node *of_find_compatible_node(struct device_node *from,
|
||||||
if (type != NULL
|
if (type != NULL
|
||||||
&& !(np->type != 0 && strcasecmp(np->type, type) == 0))
|
&& !(np->type != 0 && strcasecmp(np->type, type) == 0))
|
||||||
continue;
|
continue;
|
||||||
if (device_is_compatible(np, compatible) && of_node_get(np))
|
if (of_device_is_compatible(np, compatible) && of_node_get(np))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
of_node_put(from);
|
of_node_put(from);
|
||||||
|
|
|
@ -162,8 +162,9 @@ extern void of_detach_node(const struct device_node *);
|
||||||
extern void finish_device_tree(void);
|
extern void finish_device_tree(void);
|
||||||
extern void unflatten_device_tree(void);
|
extern void unflatten_device_tree(void);
|
||||||
extern void early_init_devtree(void *);
|
extern void early_init_devtree(void *);
|
||||||
extern int device_is_compatible(const struct device_node *device,
|
extern int of_device_is_compatible(const struct device_node *device,
|
||||||
const char *);
|
const char *);
|
||||||
|
#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
|
||||||
extern int machine_is_compatible(const char *compat);
|
extern int machine_is_compatible(const char *compat);
|
||||||
extern const void *of_get_property(const struct device_node *node,
|
extern const void *of_get_property(const struct device_node *node,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
|
Loading…
Add table
Reference in a new issue