[PATCH 4/9] ARM: imx27: Retrieve AVIC base address from devicetree

Arnd Bergmann arnd at arndb.de
Fri Sep 11 10:29:02 EDT 2020


On Fri, Sep 11, 2020 at 2:41 PM Fabio Estevam <festevam at gmail.com> wrote:
>
> Now that imx27 has been converted to a devicetree-only platform,
> retrieve the AVIC base address from devicetree.
>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>

>  static void __init mx27_init_irq(void)
>  {
> -       mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR));
> +       void __iomem *avic_base;
> +       struct device_node *np;
> +
> +       np = of_find_compatible_node(NULL, NULL, "fsl,avic");
> +       avic_base = of_iomap(np, 0);
> +       BUG_ON(!avic_base);
> +       mxc_init_irq(avic_base);
>  }
>

I see this function is identical to mx25_init_irq(). Maybe just move the code
into mxc_init_irq() directly and pass NULL from mx27_init_irq()?

Are you able to completely eliminate MX27_IO_ADDRESS()? If not,
I probably wouldn't bother, but if you can, that sounds like a useful
cleanup.

      Arnd



More information about the linux-arm-kernel mailing list