diff options
Diffstat (limited to 'arch/powerpc/platforms/maple/setup.c')
-rw-r--r-- | arch/powerpc/platforms/maple/setup.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index 57567dfb9819..fe6b9bff61b9 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c | |||
@@ -99,8 +99,7 @@ static unsigned long maple_find_nvram_base(void) | |||
99 | static void maple_restart(char *cmd) | 99 | static void maple_restart(char *cmd) |
100 | { | 100 | { |
101 | unsigned int maple_nvram_base; | 101 | unsigned int maple_nvram_base; |
102 | unsigned int maple_nvram_offset; | 102 | const unsigned int *maple_nvram_offset, *maple_nvram_command; |
103 | unsigned int maple_nvram_command; | ||
104 | struct device_node *sp; | 103 | struct device_node *sp; |
105 | 104 | ||
106 | maple_nvram_base = maple_find_nvram_base(); | 105 | maple_nvram_base = maple_find_nvram_base(); |
@@ -113,14 +112,12 @@ static void maple_restart(char *cmd) | |||
113 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); | 112 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); |
114 | goto fail; | 113 | goto fail; |
115 | } | 114 | } |
116 | maple_nvram_offset = *(unsigned int*) get_property(sp, | 115 | maple_nvram_offset = get_property(sp, "restart-addr", NULL); |
117 | "restart-addr", NULL); | 116 | maple_nvram_command = get_property(sp, "restart-value", NULL); |
118 | maple_nvram_command = *(unsigned int*) get_property(sp, | ||
119 | "restart-value", NULL); | ||
120 | of_node_put(sp); | 117 | of_node_put(sp); |
121 | 118 | ||
122 | /* send command */ | 119 | /* send command */ |
123 | outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset); | 120 | outb_p(*maple_nvram_command, maple_nvram_base + *maple_nvram_offset); |
124 | for (;;) ; | 121 | for (;;) ; |
125 | fail: | 122 | fail: |
126 | printk(KERN_EMERG "Maple: Manual Restart Required\n"); | 123 | printk(KERN_EMERG "Maple: Manual Restart Required\n"); |
@@ -129,8 +126,7 @@ static void maple_restart(char *cmd) | |||
129 | static void maple_power_off(void) | 126 | static void maple_power_off(void) |
130 | { | 127 | { |
131 | unsigned int maple_nvram_base; | 128 | unsigned int maple_nvram_base; |
132 | unsigned int maple_nvram_offset; | 129 | const unsigned int *maple_nvram_offset, *maple_nvram_command; |
133 | unsigned int maple_nvram_command; | ||
134 | struct device_node *sp; | 130 | struct device_node *sp; |
135 | 131 | ||
136 | maple_nvram_base = maple_find_nvram_base(); | 132 | maple_nvram_base = maple_find_nvram_base(); |
@@ -143,14 +139,12 @@ static void maple_power_off(void) | |||
143 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); | 139 | printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); |
144 | goto fail; | 140 | goto fail; |
145 | } | 141 | } |
146 | maple_nvram_offset = *(unsigned int*) get_property(sp, | 142 | maple_nvram_offset = get_property(sp, "power-off-addr", NULL); |
147 | "power-off-addr", NULL); | 143 | maple_nvram_command = get_property(sp, "power-off-value", NULL); |
148 | maple_nvram_command = *(unsigned int*) get_property(sp, | ||
149 | "power-off-value", NULL); | ||
150 | of_node_put(sp); | 144 | of_node_put(sp); |
151 | 145 | ||
152 | /* send command */ | 146 | /* send command */ |
153 | outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset); | 147 | outb_p(*maple_nvram_command, maple_nvram_base + *maple_nvram_offset); |
154 | for (;;) ; | 148 | for (;;) ; |
155 | fail: | 149 | fail: |
156 | printk(KERN_EMERG "Maple: Manual Power-Down Required\n"); | 150 | printk(KERN_EMERG "Maple: Manual Power-Down Required\n"); |
@@ -211,7 +205,7 @@ static void __init maple_init_early(void) | |||
211 | static void __init maple_init_IRQ(void) | 205 | static void __init maple_init_IRQ(void) |
212 | { | 206 | { |
213 | struct device_node *root, *np, *mpic_node = NULL; | 207 | struct device_node *root, *np, *mpic_node = NULL; |
214 | unsigned int *opprop; | 208 | const unsigned int *opprop; |
215 | unsigned long openpic_addr = 0; | 209 | unsigned long openpic_addr = 0; |
216 | int naddr, n, i, opplen, has_isus = 0; | 210 | int naddr, n, i, opplen, has_isus = 0; |
217 | struct mpic *mpic; | 211 | struct mpic *mpic; |
@@ -241,8 +235,7 @@ static void __init maple_init_IRQ(void) | |||
241 | /* Find address list in /platform-open-pic */ | 235 | /* Find address list in /platform-open-pic */ |
242 | root = of_find_node_by_path("/"); | 236 | root = of_find_node_by_path("/"); |
243 | naddr = prom_n_addr_cells(root); | 237 | naddr = prom_n_addr_cells(root); |
244 | opprop = (unsigned int *) get_property(root, "platform-open-pic", | 238 | opprop = get_property(root, "platform-open-pic", &opplen); |
245 | &opplen); | ||
246 | if (opprop != 0) { | 239 | if (opprop != 0) { |
247 | openpic_addr = of_read_number(opprop, naddr); | 240 | openpic_addr = of_read_number(opprop, naddr); |
248 | has_isus = (opplen > naddr); | 241 | has_isus = (opplen > naddr); |