]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
irqchip: Pass platform device to platform drivers
authorJohan Hovold <johan@kernel.org>
Mon, 13 Oct 2025 09:46:11 +0000 (11:46 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 16 Oct 2025 16:17:27 +0000 (18:17 +0200)
commit1e3e330c07076a0582385bbea029c9cc918fa30d
treee7629f3fd88ae233b9b426ba72e0033924074078
parent3540d99c03a88d4ebf65026f1f1926d3af658fb1
irqchip: Pass platform device to platform drivers

The IRQCHIP_PLATFORM_DRIVER macros can be used to convert OF irqchip
drivers to platform drivers but currently reuse the OF init callback
prototype that only takes OF nodes as arguments. This forces drivers to
do reverse lookups of their struct devices during probe if they need
them for things like dev_printk() and device managed resources.

Half of the drivers doing reverse lookups also currently fail to release
the additional reference taken during the lookup, while other drivers
have had the reference leak plugged in various ways (e.g. using
non-intuitive cleanup constructs which still confuse static checkers).

Switch to using a probe callback that takes a platform device as its
first argument to simplify drivers and plug the remaining (mostly
benign) reference leaks.

Fixes: 32c6c054661a ("irqchip: Add Broadcom BCM2712 MSI-X interrupt controller")
Fixes: 70afdab904d2 ("irqchip: Add IMX MU MSI controller driver")
Fixes: a6199bb514d8 ("irqchip: Add Qualcomm MPM controller driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Changhuang Liang <changhuang.liang@starfivetech.com>
14 files changed:
drivers/irqchip/irq-bcm2712-mip.c
drivers/irqchip/irq-bcm7038-l1.c
drivers/irqchip/irq-bcm7120-l2.c
drivers/irqchip/irq-brcmstb-l2.c
drivers/irqchip/irq-imx-mu-msi.c
drivers/irqchip/irq-mchp-eic.c
drivers/irqchip/irq-meson-gpio.c
drivers/irqchip/irq-qcom-mpm.c
drivers/irqchip/irq-renesas-rzg2l.c
drivers/irqchip/irq-renesas-rzv2h.c
drivers/irqchip/irq-starfive-jh8100-intc.c
drivers/irqchip/irqchip.c
drivers/irqchip/qcom-pdc.c
include/linux/irqchip.h