diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 23:23:46 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 23:23:46 -0500 |
| commit | f093182d313edde9b1f86dbdaf40ba4da2dbd0e7 (patch) | |
| tree | ecfc614d514bd5b43a98cf4c62fdd2f47d86e33c /arch/powerpc/kernel/prom.c | |
| parent | d27ba47e7e8c466c18983a1779d611f82d6a354f (diff) | |
| parent | 76c8e25b905f99be5ddbe999597ba7c2c33ec64b (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
| -rw-r--r-- | arch/powerpc/kernel/prom.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 3675ef4bac90..f645adb57534 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
| @@ -1974,14 +1974,29 @@ EXPORT_SYMBOL(get_property); | |||
| 1974 | /* | 1974 | /* |
| 1975 | * Add a property to a node | 1975 | * Add a property to a node |
| 1976 | */ | 1976 | */ |
| 1977 | void prom_add_property(struct device_node* np, struct property* prop) | 1977 | int prom_add_property(struct device_node* np, struct property* prop) |
| 1978 | { | 1978 | { |
| 1979 | struct property **next = &np->properties; | 1979 | struct property **next; |
| 1980 | 1980 | ||
| 1981 | prop->next = NULL; | 1981 | prop->next = NULL; |
| 1982 | while (*next) | 1982 | write_lock(&devtree_lock); |
| 1983 | next = &np->properties; | ||
| 1984 | while (*next) { | ||
| 1985 | if (strcmp(prop->name, (*next)->name) == 0) { | ||
| 1986 | /* duplicate ! don't insert it */ | ||
| 1987 | write_unlock(&devtree_lock); | ||
| 1988 | return -1; | ||
| 1989 | } | ||
| 1983 | next = &(*next)->next; | 1990 | next = &(*next)->next; |
| 1991 | } | ||
| 1984 | *next = prop; | 1992 | *next = prop; |
| 1993 | write_unlock(&devtree_lock); | ||
| 1994 | |||
| 1995 | /* try to add to proc as well if it was initialized */ | ||
| 1996 | if (np->pde) | ||
| 1997 | proc_device_tree_add_prop(np->pde, prop); | ||
| 1998 | |||
| 1999 | return 0; | ||
| 1985 | } | 2000 | } |
| 1986 | 2001 | ||
| 1987 | /* I quickly hacked that one, check against spec ! */ | 2002 | /* I quickly hacked that one, check against spec ! */ |
