diff options
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/prom.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index fd46e94ce06b..0a32b1064dfb 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c | |||
@@ -104,6 +104,18 @@ struct property *of_find_property(struct device_node *np, const char *name, | |||
104 | return pp; | 104 | return pp; |
105 | } | 105 | } |
106 | 106 | ||
107 | int of_getintprop_default(struct device_node *np, const char *name, int def) | ||
108 | { | ||
109 | struct property *prop; | ||
110 | int len; | ||
111 | |||
112 | prop = of_find_property(np, name, &len); | ||
113 | if (!prop || len != 4) | ||
114 | return def; | ||
115 | |||
116 | return *(int *) prop->value; | ||
117 | } | ||
118 | |||
107 | static unsigned int prom_early_allocated; | 119 | static unsigned int prom_early_allocated; |
108 | 120 | ||
109 | static void * __init prom_early_alloc(unsigned long size) | 121 | static void * __init prom_early_alloc(unsigned long size) |