lkml.org 
[lkml]   [2012]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 03/19] ARM: at91: make matrix register base soc independent
    On 09:17 Thu 23 Feb     , Ryan Mallon wrote:
    > On 22/02/12 20:39, Nicolas Ferre wrote:
    >
    > > From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
    > >
    > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
    > > Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
    > > Cc: linux-usb@vger.kernel.org
    > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    >
    >
    > Looks okay, one comment (for future) below, but otherwise:
    >
    > Reviewed-by: Ryan Mallon <rmallon@gmail.com>
    >
    > <snip>
    >
    > > diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
    > > index 8bdba2a..5fd6fe8 100644
    > > --- a/arch/arm/mach-at91/at91sam9263.c
    > > +++ b/arch/arm/mach-at91/at91sam9263.c
    > > @@ -306,6 +306,7 @@ static void __init at91sam9263_ioremap_registers(void)
    > > at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT);
    > > at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0);
    > > at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
    > > + at91_ioremap_matrix(AT91SAM9263_BASE_MATRIX);
    >
    >
    > Not necessarily for this patch set, but this list of functions is
    > getting long enough that it could be abstracted away by a table.
    > Something like:
    >
    > struct at91_sys_device {
    > const char *name;
    > void __iomem **base;
    > const unsigned long mem_start;
    > const unsigned long mem_size;
    > };
    >
    > ...
    >
    > static const struct
    > at91_sys_device at91sam9263_sys_devices[] __initconst = {
    > {"PIT", &at91_pit_base,
    > AT91SAM9263_BASE_PIT, AT91_PIT_SIZE},
    > ...
    > {"matrix", &at91_matrix_base,
    > AT91SAM9263_BASE_MATRIX, AT91_MATRIX_SIZE},
    > }
    >
    > ...
    >
    > void __init
    > at91_ioremap_sys_devices(const struct at91_sys_device *devices,
    > int nr_devices)
    > {
    > int i;
    >
    > for (i = 0; i < nr_devices; i++) {
    > void __iomem *base = *(dev[i].base);
    >
    > base = ioremap(dev[i].mem_start, dev[i].mem_size);
    > if (!base)
    > panic("Impossible to ioremap AT91 %s\n",
    > dev[i].name);
    > }
    we switch to the DT no need

    Best Regards,
    J.


    \
     
     \ /
      Last update: 2012-02-23 04:37    [W:0.027 / U:31.748 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site