sparc: Fix bus type probing for ESP and LE devices.
authorDavid S. Miller <davem@davemloft.net>
Tue, 26 May 2009 22:56:18 +0000 (15:56 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Jun 2009 03:01:11 +0000 (20:01 -0700)
commitaf32a18ccf468e25545a2c723a8d3ca90531a8a1
treed7d98ce86d78780897932cd9b6961e4b5048fafd
parent60962a3513a90e260d975940535ecbcfe5f5b4a4
sparc: Fix bus type probing for ESP and LE devices.

If there is a dummy "espdma" or "ledma" parent device above ESP scsi
or LE ethernet device nodes, we have to match the bus as SBUS.

Otherwise the address and size cell counts are wrong and we don't
calculate the final physical device resource values correctly at all.

Commit 5280267c1dddb8d413595b87dc406624bb497946 ("sparc: Fix handling
of LANCE and ESP parent nodes in of_device.c") was meant to fix this
problem, but that only influences the inner loop of
build_device_resources().  We need this logic to also kick in at the
beginning of build_device_resources() as well, when we make the first
attempt to determine the device's immediate parent bus type for 'reg'
property element extraction.

Based almost entirely upon a patch by Friedrich Oslage.

Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc/kernel/of_device.c
arch/sparc64/kernel/of_device.c