sparc: Fix bus type probing for ESP and LE devices.
commit2c525a3599fe8578fdb0372932dd52f1b271288b
authorDavid S. Miller <davem@davemloft.net>
Fri, 17 Apr 2009 11:14:15 +0000 (17 04:14 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:39:56 +0000 (15 09:39 -0700)
treee8cff370df51938ac34d664695edcb5d3ac8232b
parent1b725462eb20e25c555dbf6aa3e0601b8b9849ed
sparc: Fix bus type probing for ESP and LE devices.

[ Upstream commit 956d039a2537cf79ca608450d36cc70e0e515482 ]

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_32.c
arch/sparc/kernel/of_device_64.c