]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
irqchip/renesas-rzg2l: Dynamically allocate fwspec array
authorBiju Das <biju.das.jz@bp.renesas.com>
Wed, 25 Mar 2026 19:24:26 +0000 (19:24 +0000)
committerThomas Gleixner <tglx@kernel.org>
Thu, 26 Mar 2026 15:56:22 +0000 (16:56 +0100)
The total number of interrupts in RZ/G2L and RZ/G3L SoC are different. The
RZ/G3L has 16 external interrupts whereas RZ/G2L has only 8 external
interrupts. Dynamically allocate fwspec memory instead of static allocation
to support both SoCs.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260325192451.172562-12-biju.das.jz@bp.renesas.com
drivers/irqchip/irq-renesas-rzg2l.c

index bb6400ceb617bd76f477a8b1d273012ac53379f1..db5d1a5de87e1b45eddb782b8ce358e7e8e8b29e 100644 (file)
@@ -81,7 +81,7 @@ static struct rzg2l_irqc_priv {
        void __iomem                    *base;
        const struct irq_chip           *irq_chip;
        const struct irq_chip           *tint_chip;
-       struct irq_fwspec               fwspec[IRQC_NUM_IRQ];
+       struct irq_fwspec               *fwspec;
        raw_spinlock_t                  lock;
        struct rzg2l_irqc_reg_cache     cache;
 } *rzg2l_irqc_data;
@@ -630,6 +630,11 @@ static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct device_n
        if (IS_ERR(rzg2l_irqc_data->base))
                return PTR_ERR(rzg2l_irqc_data->base);
 
+       rzg2l_irqc_data->fwspec = devm_kcalloc(&pdev->dev, IRQC_NUM_IRQ,
+                                              sizeof(*rzg2l_irqc_data->fwspec), GFP_KERNEL);
+       if (!rzg2l_irqc_data->fwspec)
+               return -ENOMEM;
+
        ret = rzg2l_irqc_parse_interrupts(rzg2l_irqc_data, node);
        if (ret)
                return dev_err_probe(dev, ret, "cannot parse interrupts: %d\n", ret);