diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2006-07-12 01:35:54 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 01:55:04 -0400 |
commit | a7f67bdf2c9f24509b8e81e0f35573b611987c80 (patch) | |
tree | 201662dd6504418ef3c84cfe1f280153a4d8cb29 /arch/powerpc/kernel/legacy_serial.c | |
parent | 4288b92b9644fdb4c6168273873fe08f32090d7a (diff) |
[POWERPC] 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.
powerpc core changes.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/legacy_serial.c')
-rw-r--r-- | arch/powerpc/kernel/legacy_serial.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 359ab89748e0..ee1e0b8c7f1f 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -39,16 +39,17 @@ static int __init add_legacy_port(struct device_node *np, int want_index, | |||
39 | phys_addr_t taddr, unsigned long irq, | 39 | phys_addr_t taddr, unsigned long irq, |
40 | upf_t flags, int irq_check_parent) | 40 | upf_t flags, int irq_check_parent) |
41 | { | 41 | { |
42 | u32 *clk, *spd, clock = BASE_BAUD * 16; | 42 | const u32 *clk, *spd; |
43 | u32 clock = BASE_BAUD * 16; | ||
43 | int index; | 44 | int index; |
44 | 45 | ||
45 | /* get clock freq. if present */ | 46 | /* get clock freq. if present */ |
46 | clk = (u32 *)get_property(np, "clock-frequency", NULL); | 47 | clk = get_property(np, "clock-frequency", NULL); |
47 | if (clk && *clk) | 48 | if (clk && *clk) |
48 | clock = *clk; | 49 | clock = *clk; |
49 | 50 | ||
50 | /* get default speed if present */ | 51 | /* get default speed if present */ |
51 | spd = (u32 *)get_property(np, "current-speed", NULL); | 52 | spd = get_property(np, "current-speed", NULL); |
52 | 53 | ||
53 | /* If we have a location index, then try to use it */ | 54 | /* If we have a location index, then try to use it */ |
54 | if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS) | 55 | if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS) |
@@ -113,7 +114,7 @@ static int __init add_legacy_soc_port(struct device_node *np, | |||
113 | struct device_node *soc_dev) | 114 | struct device_node *soc_dev) |
114 | { | 115 | { |
115 | u64 addr; | 116 | u64 addr; |
116 | u32 *addrp; | 117 | const u32 *addrp; |
117 | upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; | 118 | upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; |
118 | 119 | ||
119 | /* We only support ports that have a clock frequency properly | 120 | /* We only support ports that have a clock frequency properly |
@@ -140,15 +141,15 @@ static int __init add_legacy_soc_port(struct device_node *np, | |||
140 | static int __init add_legacy_isa_port(struct device_node *np, | 141 | static int __init add_legacy_isa_port(struct device_node *np, |
141 | struct device_node *isa_brg) | 142 | struct device_node *isa_brg) |
142 | { | 143 | { |
143 | u32 *reg; | 144 | const u32 *reg; |
144 | char *typep; | 145 | const char *typep; |
145 | int index = -1; | 146 | int index = -1; |
146 | u64 taddr; | 147 | u64 taddr; |
147 | 148 | ||
148 | DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); | 149 | DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); |
149 | 150 | ||
150 | /* Get the ISA port number */ | 151 | /* Get the ISA port number */ |
151 | reg = (u32 *)get_property(np, "reg", NULL); | 152 | reg = get_property(np, "reg", NULL); |
152 | if (reg == NULL) | 153 | if (reg == NULL) |
153 | return -1; | 154 | return -1; |
154 | 155 | ||
@@ -159,7 +160,7 @@ static int __init add_legacy_isa_port(struct device_node *np, | |||
159 | /* Now look for an "ibm,aix-loc" property that gives us ordering | 160 | /* Now look for an "ibm,aix-loc" property that gives us ordering |
160 | * if any... | 161 | * if any... |
161 | */ | 162 | */ |
162 | typep = (char *)get_property(np, "ibm,aix-loc", NULL); | 163 | typep = get_property(np, "ibm,aix-loc", NULL); |
163 | 164 | ||
164 | /* If we have a location index, then use it */ | 165 | /* If we have a location index, then use it */ |
165 | if (typep && *typep == 'S') | 166 | if (typep && *typep == 'S') |
@@ -184,7 +185,7 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
184 | struct device_node *pci_dev) | 185 | struct device_node *pci_dev) |
185 | { | 186 | { |
186 | u64 addr, base; | 187 | u64 addr, base; |
187 | u32 *addrp; | 188 | const u32 *addrp; |
188 | unsigned int flags; | 189 | unsigned int flags; |
189 | int iotype, index = -1, lindex = 0; | 190 | int iotype, index = -1, lindex = 0; |
190 | 191 | ||
@@ -223,7 +224,7 @@ static int __init add_legacy_pci_port(struct device_node *np, | |||
223 | * we get to their "reg" property | 224 | * we get to their "reg" property |
224 | */ | 225 | */ |
225 | if (np != pci_dev) { | 226 | if (np != pci_dev) { |
226 | u32 *reg = (u32 *)get_property(np, "reg", NULL); | 227 | const u32 *reg = get_property(np, "reg", NULL); |
227 | if (reg && (*reg < 4)) | 228 | if (reg && (*reg < 4)) |
228 | index = lindex = *reg; | 229 | index = lindex = *reg; |
229 | } | 230 | } |
@@ -281,13 +282,13 @@ static void __init setup_legacy_serial_console(int console) | |||
281 | void __init find_legacy_serial_ports(void) | 282 | void __init find_legacy_serial_ports(void) |
282 | { | 283 | { |
283 | struct device_node *np, *stdout = NULL; | 284 | struct device_node *np, *stdout = NULL; |
284 | char *path; | 285 | const char *path; |
285 | int index; | 286 | int index; |
286 | 287 | ||
287 | DBG(" -> find_legacy_serial_port()\n"); | 288 | DBG(" -> find_legacy_serial_port()\n"); |
288 | 289 | ||
289 | /* Now find out if one of these is out firmware console */ | 290 | /* Now find out if one of these is out firmware console */ |
290 | path = (char *)get_property(of_chosen, "linux,stdout-path", NULL); | 291 | path = get_property(of_chosen, "linux,stdout-path", NULL); |
291 | if (path != NULL) { | 292 | if (path != NULL) { |
292 | stdout = of_find_node_by_path(path); | 293 | stdout = of_find_node_by_path(path); |
293 | if (stdout) | 294 | if (stdout) |
@@ -487,8 +488,8 @@ static int __init check_legacy_serial_console(void) | |||
487 | { | 488 | { |
488 | struct device_node *prom_stdout = NULL; | 489 | struct device_node *prom_stdout = NULL; |
489 | int speed = 0, offset = 0; | 490 | int speed = 0, offset = 0; |
490 | char *name; | 491 | const char *name; |
491 | u32 *spd; | 492 | const u32 *spd; |
492 | 493 | ||
493 | DBG(" -> check_legacy_serial_console()\n"); | 494 | DBG(" -> check_legacy_serial_console()\n"); |
494 | 495 | ||
@@ -509,7 +510,7 @@ static int __init check_legacy_serial_console(void) | |||
509 | } | 510 | } |
510 | /* We are getting a weird phandle from OF ... */ | 511 | /* We are getting a weird phandle from OF ... */ |
511 | /* ... So use the full path instead */ | 512 | /* ... So use the full path instead */ |
512 | name = (char *)get_property(of_chosen, "linux,stdout-path", NULL); | 513 | name = get_property(of_chosen, "linux,stdout-path", NULL); |
513 | if (name == NULL) { | 514 | if (name == NULL) { |
514 | DBG(" no linux,stdout-path !\n"); | 515 | DBG(" no linux,stdout-path !\n"); |
515 | return -ENODEV; | 516 | return -ENODEV; |
@@ -521,12 +522,12 @@ static int __init check_legacy_serial_console(void) | |||
521 | } | 522 | } |
522 | DBG("stdout is %s\n", prom_stdout->full_name); | 523 | DBG("stdout is %s\n", prom_stdout->full_name); |
523 | 524 | ||
524 | name = (char *)get_property(prom_stdout, "name", NULL); | 525 | name = get_property(prom_stdout, "name", NULL); |
525 | if (!name) { | 526 | if (!name) { |
526 | DBG(" stdout package has no name !\n"); | 527 | DBG(" stdout package has no name !\n"); |
527 | goto not_found; | 528 | goto not_found; |
528 | } | 529 | } |
529 | spd = (u32 *)get_property(prom_stdout, "current-speed", NULL); | 530 | spd = get_property(prom_stdout, "current-speed", NULL); |
530 | if (spd) | 531 | if (spd) |
531 | speed = *spd; | 532 | speed = *spd; |
532 | 533 | ||