From 46bcea7751efc867ae4b073c99ad1d137a475bc0 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 7 Aug 2007 18:46:36 -0700 Subject: [SPARC]: Centralize find_in_proplist() instead of duplicating N times. Signed-off-by: David S. Miller --- arch/sparc64/kernel/prom.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/sparc64/kernel/prom.c') diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index f4e0a9ad9be3..d1a78c976cef 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c @@ -107,6 +107,21 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len } EXPORT_SYMBOL(of_set_property); +int of_find_in_proplist(const char *list, const char *match, int len) +{ + while (len > 0) { + int l; + + if (!strcmp(list, match)) + return 1; + l = strlen(list) + 1; + list += l; + len -= l; + } + return 0; +} +EXPORT_SYMBOL(of_find_in_proplist); + static unsigned int prom_early_allocated; static void * __init prom_early_alloc(unsigned long size) -- cgit v1.2.3