Skip to content

Commit

Permalink
[PATCH] fix ancient breakage in ebus_init()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Sep 23, 2006
1 parent a83fbf6 commit cc9bd99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arch/sparc/kernel/ebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void __init ebus_init(void)
struct pci_dev *pdev;
struct pcidev_cookie *cookie;
struct device_node *dp;
unsigned long addr, *base;
struct resource *p;
unsigned short pci_command;
int len, reg, nreg;
int num_ebus = 0;
Expand Down Expand Up @@ -321,13 +321,12 @@ void __init ebus_init(void)
}
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++) {
if (!(regs[reg].which_io & 0x03000000))
continue;

addr = regs[reg].phys_lo;
*base++ = addr;
(p++)->start = regs[reg].phys_lo;
}

ebus->ofdev.node = dp;
Expand Down

0 comments on commit cc9bd99

Please sign in to comment.