Commit cc9bd99e authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a83fbf63
...@@ -277,7 +277,7 @@ void __init ebus_init(void) ...@@ -277,7 +277,7 @@ void __init ebus_init(void)
struct pci_dev *pdev; struct pci_dev *pdev;
struct pcidev_cookie *cookie; struct pcidev_cookie *cookie;
struct device_node *dp; struct device_node *dp;
unsigned long addr, *base; struct resource *p;
unsigned short pci_command; unsigned short pci_command;
int len, reg, nreg; int len, reg, nreg;
int num_ebus = 0; int num_ebus = 0;
...@@ -321,13 +321,12 @@ void __init ebus_init(void) ...@@ -321,13 +321,12 @@ void __init ebus_init(void)
} }
nreg = len / sizeof(struct linux_prom_pci_registers); nreg = len / sizeof(struct linux_prom_pci_registers);
base = &ebus->self->resource[0].start; p = &ebus->self->resource[0];
for (reg = 0; reg < nreg; reg++) { for (reg = 0; reg < nreg; reg++) {
if (!(regs[reg].which_io & 0x03000000)) if (!(regs[reg].which_io & 0x03000000))
continue; continue;
addr = regs[reg].phys_lo; (p++)->start = regs[reg].phys_lo;
*base++ = addr;
} }
ebus->ofdev.node = dp; ebus->ofdev.node = dp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment