fsl_soc: Fix get_immrbase() to use ranges, rather than reg.
PATCH 1/1 fsl_soc: Fix get_immrbase() to use ranges, rather than reg.
The reg property in fsl soc nodes should be removed.
Signed-off-by Scott Wood <[email protected]>
--- arch/powerpc/sysdev/fsl_soc.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)
arch/powerpc/sysdev/fsl_soc.c +11 -3
@@ -54,10 +54,18 @@ phys_addr_t get_immrbase(void) soc =of_find_node_by_type (NULL ,"soc" );if (soc) {int size; -const void *prop =of_get_property (soc,"reg" , &size); +u32 naddr; +const u32 *prop =of_get_property (soc,"#address-cells" , &size); + +if (prop && size ==4 ) + naddr = *prop; +else + naddr =2 ; + + prop =of_get_property (soc,"ranges" , &size); +if (prop) + immrbase =of_translate_address (soc, prop + naddr); -if (prop) - immrbase =of_translate_address (soc, prop);of_node_put (soc); }
Signature · 1 line
1.5.3