aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-05-01 02:29:19 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2007-07-19 23:29:51 -0400
commit0081cbc3731de8ad4744ba433af51f17bf27eb9c (patch)
treeb03e5c4b7087ad78a230722850a29a72b2960663 /arch/sparc64
parent97e873e5c8ad8711ce4cca080cff4eb5d21b3aeb (diff)
Consolidate of_device_is_compatible
The only difference here is that Sparc uses strncmp to match compatibility names while PowerPC uses strncasecmp. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/prom.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 8f926d439c0f..4d6fb07f047f 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -37,27 +37,6 @@ static struct device_node *allnodes;
37 */ 37 */
38static DEFINE_RWLOCK(devtree_lock); 38static DEFINE_RWLOCK(devtree_lock);
39 39
40int of_device_is_compatible(const struct device_node *device,
41 const char *compat)
42{
43 const char* cp;
44 int cplen, l;
45
46 cp = of_get_property(device, "compatible", &cplen);
47 if (cp == NULL)
48 return 0;
49 while (cplen > 0) {
50 if (strncmp(cp, compat, strlen(compat)) == 0)
51 return 1;
52 l = strlen(cp) + 1;
53 cp += l;
54 cplen -= l;
55 }
56
57 return 0;
58}
59EXPORT_SYMBOL(of_device_is_compatible);
60
61struct device_node *of_get_parent(const struct device_node *node) 40struct device_node *of_get_parent(const struct device_node *node)
62{ 41{
63 struct device_node *np; 42 struct device_node *np;