Hi all,
Recently, Marc pointed out some common misconceptions w.r.t. the .name
and .parent_device fields in struct irq_chip. This patch series fixes
them in the Renesas interrupt controller drivers.
The first two patches are destined for the irqchip tree, the last two
for the GPIO tree.
Thanks!
Geert Uytterhoeven (4):
irqchip/renesas-intc-irqpin: Use proper irq_chip name and parent
irqchip/renesas-irqc: Use proper irq_chip name and parent
gpio: em: Use proper irq_chip name
gpio: rcar: Use proper irq_chip name
drivers/gpio/gpio-em.c | 2 +-
drivers/gpio/gpio-rcar.c | 2 +-
drivers/irqchip/irq-renesas-intc-irqpin.c | 3 ++-
drivers/irqchip/irq-renesas-irqc.c | 3 ++-
4 files changed, 6 insertions(+), 4 deletions(-)
--
2.17.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
The irq_chip .name field should contain the device's class name, not the
instance's name.
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
Untested due to lack of hardware.
.parent_device not filled in as this driver doesn't use Runtime PM.
---
drivers/gpio/gpio-em.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index b6af705a4e5f4810..6aa08d37932adf2c 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -318,7 +318,7 @@ static int em_gio_probe(struct platform_device *pdev)
gpio_chip->ngpio = ngpios;
irq_chip = &p->irq_chip;
- irq_chip->name = name;
+ irq_chip->name = "gpio-em";
irq_chip->irq_mask = em_gio_irq_disable;
irq_chip->irq_unmask = em_gio_irq_enable;
irq_chip->irq_set_type = em_gio_irq_set_type;
--
2.17.1
The irq_chip .name field should contain the device's class (not
instance) name, while .parent_device should point to the device itself.
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/irqchip/irq-renesas-irqc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c
index cde9f9c0687e94a4..11abc09ef76c62b5 100644
--- a/drivers/irqchip/irq-renesas-irqc.c
+++ b/drivers/irqchip/irq-renesas-irqc.c
@@ -176,7 +176,7 @@ static int irqc_probe(struct platform_device *pdev)
}
ret = irq_alloc_domain_generic_chips(p->irq_domain, p->number_of_irqs,
- 1, name, handle_level_irq,
+ 1, "irqc", handle_level_irq,
0, 0, IRQ_GC_INIT_NESTED_LOCK);
if (ret) {
dev_err(dev, "cannot allocate generic chip\n");
@@ -187,6 +187,7 @@ static int irqc_probe(struct platform_device *pdev)
p->gc->reg_base = p->cpu_int_base;
p->gc->chip_types[0].regs.enable = IRQC_EN_SET;
p->gc->chip_types[0].regs.disable = IRQC_EN_STS;
+ p->gc->chip_types[0].chip.parent_device = dev;
p->gc->chip_types[0].chip.irq_mask = irq_gc_mask_disable_reg;
p->gc->chip_types[0].chip.irq_unmask = irq_gc_unmask_enable_reg;
p->gc->chip_types[0].chip.irq_set_type = irqc_irq_set_type;
--
2.17.1
The irq_chip .name field should contain the device's class (not
instance) name, while .parent_device should point to the device itself.
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/irqchip/irq-renesas-intc-irqpin.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c
index 04c05a18600cf71f..f82bc60a67931cd7 100644
--- a/drivers/irqchip/irq-renesas-intc-irqpin.c
+++ b/drivers/irqchip/irq-renesas-intc-irqpin.c
@@ -508,7 +508,8 @@ static int intc_irqpin_probe(struct platform_device *pdev)
}
irq_chip = &p->irq_chip;
- irq_chip->name = name;
+ irq_chip->name = "intc-irqpin";
+ irq_chip->parent_device = dev;
irq_chip->irq_mask = disable_fn;
irq_chip->irq_unmask = enable_fn;
irq_chip->irq_set_type = intc_irqpin_irq_set_type;
--
2.17.1
The irq_chip .name field should contain the device's class name, not the
instance's name.
Signed-off-by: Geert Uytterhoeven <[email protected]>
---
drivers/gpio/gpio-rcar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 70e95fc4779fe262..3ae58f182a08718a 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -483,7 +483,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
gpio_chip->ngpio = npins;
irq_chip = &p->irq_chip;
- irq_chip->name = name;
+ irq_chip->name = "gpio-rcar";
irq_chip->parent_device = dev;
irq_chip->irq_mask = gpio_rcar_irq_disable;
irq_chip->irq_unmask = gpio_rcar_irq_enable;
--
2.17.1
On 07/06/2019 10:58, Geert Uytterhoeven wrote:
> Hi all,
>
> Recently, Marc pointed out some common misconceptions w.r.t. the .name
> and .parent_device fields in struct irq_chip. This patch series fixes
> them in the Renesas interrupt controller drivers.
>
> The first two patches are destined for the irqchip tree, the last two
> for the GPIO tree.
>
> Thanks!
>
> Geert Uytterhoeven (4):
> irqchip/renesas-intc-irqpin: Use proper irq_chip name and parent
> irqchip/renesas-irqc: Use proper irq_chip name and parent
> gpio: em: Use proper irq_chip name
> gpio: rcar: Use proper irq_chip name
>
> drivers/gpio/gpio-em.c | 2 +-
> drivers/gpio/gpio-rcar.c | 2 +-
> drivers/irqchip/irq-renesas-intc-irqpin.c | 3 ++-
> drivers/irqchip/irq-renesas-irqc.c | 3 ++-
> 4 files changed, 6 insertions(+), 4 deletions(-)
>
I've applied patches 1 and2 to the irqchip tree.
Thanks,
M.
--
Jazz is not dead. It just smells funny...