Message ID | 20211019215855.1920099-2-f.fainelli@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Modular Broadcom irqchip drivers | expand |
AOn Tue, 19 Oct 2021 22:58:42 +0100, Florian Fainelli <f.fainelli@gmail.com> wrote: > > Provide the platform device mapping to the interrupt controller node to > the of_irq_init_cb_t callback such that drivers can make use of it. > > Reviewed-by: Rob Herring <robh@kernel.org> > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> > --- > drivers/irqchip/irqchip.c | 2 +- > drivers/irqchip/qcom-pdc.c | 3 ++- > drivers/of/irq.c | 2 +- > include/linux/of_irq.h | 5 ++++- > 4 files changed, 8 insertions(+), 4 deletions(-) > [...] > diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h > index aaf219bd0354..89acc8b089f0 100644 > --- a/include/linux/of_irq.h > +++ b/include/linux/of_irq.h > @@ -9,7 +9,10 @@ > #include <linux/ioport.h> > #include <linux/of.h> > > -typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); > +struct platform_device; > + > +typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *, > + struct platform_device *); > > /* > * Workarounds only applied to 32bit powermac machines As pointed out in my reply to your v4 [1], this does break all users of IRQCHIP_DECLARE(). You can see that by applying [2]. M. [1] https://lore.kernel.org/r/87tuhcnlwt.wl-maz@kernel.org [2] https://lore.kernel.org/r/20211020104527.3066268-1-maz@kernel.org
diff --git a/drivers/irqchip/irqchip.c b/drivers/irqchip/irqchip.c index 3570f0a588c4..289784eefd00 100644 --- a/drivers/irqchip/irqchip.c +++ b/drivers/irqchip/irqchip.c @@ -55,6 +55,6 @@ int platform_irqchip_probe(struct platform_device *pdev) if (par_np && !irq_find_matching_host(par_np, DOMAIN_BUS_ANY)) return -EPROBE_DEFER; - return irq_init_cb(np, par_np); + return irq_init_cb(np, par_np, pdev); } EXPORT_SYMBOL_GPL(platform_irqchip_probe); diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index 173e6520e06e..819a93360b96 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -359,7 +359,8 @@ static int pdc_setup_pin_mapping(struct device_node *np) return 0; } -static int qcom_pdc_init(struct device_node *node, struct device_node *parent) +static int qcom_pdc_init(struct device_node *node, struct device_node *parent, + struct platform_device *pdev) { struct irq_domain *parent_domain, *pdc_domain, *pdc_gpio_domain; int ret; diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 352e14b007e7..18f3f5c00c87 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -538,7 +538,7 @@ void __init of_irq_init(const struct of_device_id *matches) desc->dev, desc->dev, desc->interrupt_parent); ret = desc->irq_init_cb(desc->dev, - desc->interrupt_parent); + desc->interrupt_parent, NULL); if (ret) { of_node_clear_flag(desc->dev, OF_POPULATED); kfree(desc); diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index aaf219bd0354..89acc8b089f0 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -9,7 +9,10 @@ #include <linux/ioport.h> #include <linux/of.h> -typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *); +struct platform_device; + +typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *, + struct platform_device *); /* * Workarounds only applied to 32bit powermac machines