[PATCH 07/10] ARM: clps711x: Add CLPS711X irqchip driver

Alexander Shiyan shc_work at mail.ru
Sun Aug 4 00:50:46 EDT 2013


On Sat, 3 Aug 2013 21:45:41 +0200
Arnd Bergmann <arnd at arndb.de> wrote:

[...]
> > +static void __iomem __init *clps711x_ioremap_one(phys_addr_t reg)
> > +{
> > +       void __iomem *ret;
> > +
> > +       if (!request_mem_region(clps711x_intc->phys_base + reg, SZ_4, NULL))
> > +               return ERR_PTR(-EBUSY);
> > +
> > +       ret = ioremap(clps711x_intc->phys_base + reg, SZ_4);
> > +       if (!ret)
> > +               return ERR_PTR(-ENOMEM);
> > +
> > +       return ret;
> 
> Another unrelated comment: Doing repeated ioremap() and request_mem_region calls
> is rather wasteful as every single call will consume resources. Better do a single
> ioremap in the probe function and just add the offsets later.

Registers are not arranged linearly for each submodule, so for example there are
registers for LCD, Timers, PWM, UART etc. between INTMR1 and INTMR2.
Single request cannot be used here, since it block access to these holes from drivers.
Thanks.

-- 
Alexander Shiyan <shc_work at mail.ru>



More information about the linux-arm-kernel mailing list