[PATCH v3 02/10] powerpc: Consolidate mpic_alloc() OF address translation

Kumar Gala galak at kernel.crashing.org
Sun Dec 4 02:53:27 EST 2011


On Dec 2, 2011, at 10:27 AM, Kyle Moffett wrote:

> Instead of using the open-coded "reg" property lookup and address
> translation in mpic_alloc(), directly call of_address_to_resource().
> This includes various workarounds for special cases which the naive
> of_address_translate() does not.
> 
> Afterwards it is possible to remove the copiously copy-pasted calls to
> of_address_translate() from the 85xx/86xx/powermac platforms.
> 
> Signed-off-by: Kyle Moffett <Kyle.D.Moffett at boeing.com>
> Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Cc: Paul Mackerras <paulus at samba.org>
> Cc: Grant Likely <grant.likely at secretlab.ca>
> Cc: Kumar Gala <galak at kernel.crashing.org>
> ---
> arch/powerpc/platforms/85xx/corenet_ds.c  |    9 +----
> arch/powerpc/platforms/85xx/ksi8560.c     |    9 +----
> arch/powerpc/platforms/85xx/mpc8536_ds.c  |    9 +----
> arch/powerpc/platforms/85xx/mpc85xx_ads.c |    9 +----
> arch/powerpc/platforms/85xx/mpc85xx_cds.c |    9 +----
> arch/powerpc/platforms/85xx/mpc85xx_ds.c  |   11 +----
> arch/powerpc/platforms/85xx/mpc85xx_mds.c |    9 +----
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c |   11 +----
> arch/powerpc/platforms/85xx/p1010rdb.c    |    9 +----
> arch/powerpc/platforms/85xx/p1022_ds.c    |    9 +----
> arch/powerpc/platforms/85xx/p1023_rds.c   |    9 +----
> arch/powerpc/platforms/85xx/sbc8548.c     |    9 +----
> arch/powerpc/platforms/85xx/sbc8560.c     |    9 +----
> arch/powerpc/platforms/85xx/socrates.c    |    9 +----
> arch/powerpc/platforms/85xx/stx_gp3.c     |    9 +----
> arch/powerpc/platforms/85xx/tqm85xx.c     |    9 +----
> arch/powerpc/platforms/85xx/xes_mpc85xx.c |    9 +----
> arch/powerpc/platforms/86xx/pic.c         |    4 +-
> arch/powerpc/platforms/powermac/pic.c     |    8 +---
> arch/powerpc/sysdev/mpic.c                |   61 ++++++++++++++++-------------
> 20 files changed, 55 insertions(+), 175 deletions(-)

What about cleaning up:

arch/powerpc/platforms/chrp/setup.c:    chrp_mpic = mpic_alloc(np, opaddr, MPIC_PRIMARY,
arch/powerpc/platforms/embedded6xx/holly.c:     mpic = mpic_alloc(tsi_pic, mpic_paddr,
arch/powerpc/platforms/embedded6xx/linkstation.c:       mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c:      mpic = mpic_alloc(tsi_pic, mpic_paddr,
arch/powerpc/platforms/embedded6xx/storcenter.c:        mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC
arch/powerpc/platforms/maple/setup.c:   mpic = mpic_alloc(mpic_node, openpic_addr, flags,
arch/powerpc/platforms/pasemi/setup.c:  mpic = mpic_alloc(mpic_node, openpic_addr,
arch/powerpc/platforms/pseries/setup.c: mpic = mpic_alloc(pSeries_mpic_node, openpic_addr,

Seems like we should be able to remove the 'phys_addr' argument altogether.

- k


More information about the Linuxppc-dev mailing list