diff options
author | Bartosz Golaszewski <brgl@bgdev.pl> | 2017-05-31 18:06:56 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-06-21 15:53:10 +0200 |
commit | 707188f5f2421a304324e6ef3aaf4413cfab0f3d (patch) | |
tree | 8e8370ac67e0041e675cb756230985712cd0a6d8 /include/linux/irq.h | |
parent | b50fb7c99217922ea36d6e38bae34d84c0587cad (diff) |
irq/generic-chip: Provide irq_free_generic_chip()
Currently there's no way for users of irq_alloc_generic_chip() to free
the allocated memory other than calling kfree() manually on the
returned pointer. This may lead to errors if the internals of
irq_alloc_generic_chip() ever change. Provide a routine to free the
generic chip.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-doc@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>
Link: http://lkml.kernel.org/r/1496246820-13250-2-git-send-email-brgl@bgdev.pl
Diffstat (limited to 'include/linux/irq.h')
-rw-r--r-- | include/linux/irq.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index 94d1ad6ffdd4..2c957fe5d9d7 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -22,6 +22,7 @@ #include <linux/topology.h> #include <linux/wait.h> #include <linux/io.h> +#include <linux/slab.h> #include <asm/irq.h> #include <asm/ptrace.h> @@ -973,6 +974,11 @@ int __irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip, handler, clr, set, flags); \ }) +static inline void irq_free_generic_chip(struct irq_chip_generic *gc) +{ + kfree(gc); +} + static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) { return container_of(d->chip, struct irq_chip_type, chip); |