diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-05-01 02:29:19 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-07-19 23:29:51 -0400 |
commit | 0081cbc3731de8ad4744ba433af51f17bf27eb9c (patch) | |
tree | b03e5c4b7087ad78a230722850a29a72b2960663 /arch/sparc | |
parent | 97e873e5c8ad8711ce4cca080cff4eb5d21b3aeb (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/sparc')
-rw-r--r-- | arch/sparc/kernel/prom.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c index ac3f3c29b174..f2ce0d48e102 100644 --- a/arch/sparc/kernel/prom.c +++ b/arch/sparc/kernel/prom.c | |||
@@ -32,27 +32,6 @@ static struct device_node *allnodes; | |||
32 | */ | 32 | */ |
33 | static DEFINE_RWLOCK(devtree_lock); | 33 | static DEFINE_RWLOCK(devtree_lock); |
34 | 34 | ||
35 | int of_device_is_compatible(const struct device_node *device, | ||
36 | const char *compat) | ||
37 | { | ||
38 | const char* cp; | ||
39 | int cplen, l; | ||
40 | |||
41 | cp = of_get_property(device, "compatible", &cplen); | ||
42 | if (cp == NULL) | ||
43 | return 0; | ||
44 | while (cplen > 0) { | ||
45 | if (strncmp(cp, compat, strlen(compat)) == 0) | ||
46 | return 1; | ||
47 | l = strlen(cp) + 1; | ||
48 | cp += l; | ||
49 | cplen -= l; | ||
50 | } | ||
51 | |||
52 | return 0; | ||
53 | } | ||
54 | EXPORT_SYMBOL(of_device_is_compatible); | ||
55 | |||
56 | struct device_node *of_get_parent(const struct device_node *node) | 35 | struct device_node *of_get_parent(const struct device_node *node) |
57 | { | 36 | { |
58 | struct device_node *np; | 37 | struct device_node *np; |