Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112980
b: refs/heads/master
c: 2481d76
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Aug 25, 2008
1 parent 4968701 commit 67f68b1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 072bd413b88c17509c7aa7dbc398ab8bade633b3
refs/heads/master: 2481d76615d5e15340ccfb0243fe8779766dfc6e
2 changes: 2 additions & 0 deletions trunk/arch/sparc/include/asm/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <linux/mutex.h>
#include <asm/atomic.h>

#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
Expand Down Expand Up @@ -73,6 +74,7 @@ struct of_irq_controller {

extern struct device_node *of_find_node_by_cpuid(int cpuid);
extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
extern struct mutex of_set_property_mutex;
extern int of_getintprop_default(struct device_node *np,
const char *name,
int def);
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/sparc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL(of_getintprop_default);

DEFINE_MUTEX(of_set_property_mutex);
EXPORT_SYMBOL(of_set_property_mutex);

int of_set_property(struct device_node *dp, const char *name, void *val, int len)
{
struct property **prevp;
Expand All @@ -77,7 +80,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
void *old_val = prop->value;
int ret;

mutex_lock(&of_set_property_mutex);
ret = prom_setprop(dp->node, (char *) name, val, len);
mutex_unlock(&of_set_property_mutex);

err = -EINVAL;
if (ret >= 0) {
prop->value = new_val;
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/sparc64/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ int of_getintprop_default(struct device_node *np, const char *name, int def)
}
EXPORT_SYMBOL(of_getintprop_default);

DEFINE_MUTEX(of_set_property_mutex);
EXPORT_SYMBOL(of_set_property_mutex);

int of_set_property(struct device_node *dp, const char *name, void *val, int len)
{
struct property **prevp;
Expand All @@ -82,7 +85,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
void *old_val = prop->value;
int ret;

mutex_lock(&of_set_property_mutex);
ret = prom_setprop(dp->node, name, val, len);
mutex_unlock(&of_set_property_mutex);

err = -EINVAL;
if (ret >= 0) {
prop->value = new_val;
Expand Down

0 comments on commit 67f68b1

Please sign in to comment.