diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-renesas-rzg2l.c index 06caa2258334..5387e901075e 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -21,7 +21,6 @@ #include #define IRQC_IRQ_START 1 -#define IRQC_IRQ_COUNT 8 #define IRQC_TINT_COUNT 32 #define ISCR 0x10 @@ -68,10 +67,12 @@ struct rzg2l_irqc_reg_cache { /** * struct rzg2l_hw_info - Interrupt Control Unit controller hardware info structure. + * @irq_count: Number of IRQC interrupts * @tint_start: Start of TINT interrupts * @num_irq: Total Number of interrupts */ struct rzg2l_hw_info { + unsigned int irq_count; unsigned int tint_start; unsigned int num_irq; }; @@ -573,7 +574,7 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, unsigned int virq, * from 16-31 bits. TINT from the pinctrl driver needs to be programmed * in IRQC registers to enable a given gpio pin as interrupt. */ - if (hwirq > IRQC_IRQ_COUNT) { + if (hwirq > priv->info.irq_count) { tint = TINT_EXTRACT_GPIOINT(hwirq); hwirq = TINT_EXTRACT_HWIRQ(hwirq); chip = priv->tint_chip; @@ -681,8 +682,9 @@ static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct device_n } static const struct rzg2l_hw_info rzg2l_hw_params = { - .tint_start = IRQC_IRQ_START + IRQC_IRQ_COUNT, - .num_irq = IRQC_IRQ_START + IRQC_IRQ_COUNT + IRQC_TINT_COUNT, + .irq_count = 8, + .tint_start = IRQC_IRQ_START + 8, + .num_irq = IRQC_IRQ_START + 8 + IRQC_TINT_COUNT, }; static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_node *parent)