]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros
authorSaravana Kannan <saravanak@google.com>
Sat, 18 Jul 2020 00:06:34 +0000 (17:06 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 27 Jul 2020 07:55:04 +0000 (08:55 +0100)
commitff7e02df58b9a653fa06cfec9d1e8bef81345eb9
tree27a0ff84dc44cb90ea5bf14384ced4d819e981af
parentb29e639155256309c1e7a85db017950332fe804e
irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros

Compiling an irqchip driver as a platform driver needs to bunch of
things to be done right:
- Making sure the parent domain is initialized first
- Making sure the device can't be unbound from sysfs
- Disallowing module unload if it's built as a module
- Finding the parent node
- Etc.

Instead of trying to make sure all future irqchip platform drivers get
this right, provide boilerplate macros that take care of all of this.

An example use would look something like this. Where acme_foo_init and
acme_bar_init are similar to what would be passed to IRQCHIP_DECLARE.

IRQCHIP_PLATFORM_DRIVER_BEGIN(acme_irq)
IRQCHIP_MATCH("acme,foo", acme_foo_init)
IRQCHIP_MATCH("acme,bar", acme_bar_init)
IRQCHIP_PLATFORM_DRIVER_END(acme_irq)

Signed-off-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: John Stultz <john.stultz@linaro.org>
Link: https://lore.kernel.org/r/20200718000637.3632841-2-saravanak@google.com
drivers/irqchip/irqchip.c
include/linux/irqchip.h