aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/maple/setup.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2006-07-12 01:40:17 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-31 01:55:05 -0400
commiteeb2b723ef5100fafa381d92eb70d83e98516a44 (patch)
tree782883072f3ec64cd795c3c2a69322647ce5f96c /arch/powerpc/platforms/maple/setup.c
parentae6b4101e53dcf8a41f3432dacca9d3eb34e9cc3 (diff)
[POWERPC] maple: Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its return value. Also, treat the return value as const, so we can constify get_property later. maple platform changes. Built for maple_defconfig Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/maple/setup.c')
-rw-r--r--arch/powerpc/platforms/maple/setup.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index cb528c9de4c..ecc764a3ff3 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)
99static void maple_restart(char *cmd) 99static 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)
129static void maple_power_off(void) 126static 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)
211static void __init maple_init_IRQ(void) 205static 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;
@@ -234,8 +228,7 @@ static void __init maple_init_IRQ(void)
234 /* Find address list in /platform-open-pic */ 228 /* Find address list in /platform-open-pic */
235 root = of_find_node_by_path("/"); 229 root = of_find_node_by_path("/");
236 naddr = prom_n_addr_cells(root); 230 naddr = prom_n_addr_cells(root);
237 opprop = (unsigned int *) get_property(root, "platform-open-pic", 231 opprop = get_property(root, "platform-open-pic", &opplen);
238 &opplen);
239 if (opprop != 0) { 232 if (opprop != 0) {
240 openpic_addr = of_read_number(opprop, naddr); 233 openpic_addr = of_read_number(opprop, naddr);
241 has_isus = (opplen > naddr); 234 has_isus = (opplen > naddr);