Subject: spu_manage: fix spu_unit_number for celleb device tree From: Christian Krafft New device trees provide "physical-id". Celleb device tree provide the "unit-id". Legacy device tree used the reg property for the physical id of an spe. This patch fixes find_spu_unit_number to look for the spu id in that order. The length is checked to avoid misinterpretation in case the attributes unit-id or reg do not contain the id. Signed-off-by: Christian Krafft Signed-off-by: Arnd Bergmann Index: linux-2.6/arch/powerpc/platforms/cell/spu_manage.c =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/cell/spu_manage.c +++ linux-2.6/arch/powerpc/platforms/cell/spu_manage.c @@ -48,10 +48,18 @@ static u64 __init find_spu_unit_number(s { const unsigned int *prop; int proplen; + + /* new device trees should provide the physical-id attribute */ prop = of_get_property(spe, "physical-id", &proplen); if (proplen == 4) return (u64)*prop; + /* celleb device tree provides the unit-id */ + prop = of_get_property(spe, "unit-id", &proplen); + if (proplen == 4) + return (u64)*prop; + + /* legacy device trees provide the id in the reg attribute */ prop = of_get_property(spe, "reg", &proplen); if (proplen == 4) return (u64)*prop;