diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-09-22 20:18:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-22 20:48:56 -0400 |
commit | cc9bd99e9adfa4f44ea050a63fb41a3f764acf84 (patch) | |
tree | d8f4512b107305f119d727e7fd3f523fd9125f4e /arch/sparc/kernel/ebus.c | |
parent | a83fbf635992442edf6aa3252e4008d4a08edf12 (diff) |
[PATCH] fix ancient breakage in ebus_init()
Back when pci_dev had base_address[], loop of form
base = &...->base_address[0];
for (.....) {
...
*base++ = addr;
}
was fine, but when that array got spread in ->resource[...].start
replacing the initialization with
base = &...->resource[0].start;
was not a sufficient modification. IOW this code got broken for cases
when there had been more than one resource to fill. All way back in
2.3.41-pre3...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/sparc/kernel/ebus.c')
-rw-r--r-- | arch/sparc/kernel/ebus.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c index 81c0cbd96ff..75ac24d229b 100644 --- a/arch/sparc/kernel/ebus.c +++ b/arch/sparc/kernel/ebus.c | |||
@@ -277,7 +277,7 @@ void __init ebus_init(void) | |||
277 | struct pci_dev *pdev; | 277 | struct pci_dev *pdev; |
278 | struct pcidev_cookie *cookie; | 278 | struct pcidev_cookie *cookie; |
279 | struct device_node *dp; | 279 | struct device_node *dp; |
280 | unsigned long addr, *base; | 280 | struct resource *p; |
281 | unsigned short pci_command; | 281 | unsigned short pci_command; |
282 | int len, reg, nreg; | 282 | int len, reg, nreg; |
283 | int num_ebus = 0; | 283 | int num_ebus = 0; |
@@ -321,13 +321,12 @@ void __init ebus_init(void) | |||
321 | } | 321 | } |
322 | nreg = len / sizeof(struct linux_prom_pci_registers); | 322 | nreg = len / sizeof(struct linux_prom_pci_registers); |
323 | 323 | ||
324 | base = &ebus->self->resource[0].start; | 324 | p = &ebus->self->resource[0]; |
325 | for (reg = 0; reg < nreg; reg++) { | 325 | for (reg = 0; reg < nreg; reg++) { |
326 | if (!(regs[reg].which_io & 0x03000000)) | 326 | if (!(regs[reg].which_io & 0x03000000)) |
327 | continue; | 327 | continue; |
328 | 328 | ||
329 | addr = regs[reg].phys_lo; | 329 | (p++)->start = regs[reg].phys_lo; |
330 | *base++ = addr; | ||
331 | } | 330 | } |
332 | 331 | ||
333 | ebus->ofdev.node = dp; | 332 | ebus->ofdev.node = dp; |