From: Bartosz Golaszewski Date: Wed, 31 May 2017 16:06:57 +0000 (+0200) Subject: irq/generic-chip: Provide irq_destroy_generic_chip() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=32bb6cbb3b4ea5ca24e3fa13e11772c192616e04;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git irq/generic-chip: Provide irq_destroy_generic_chip() Most users of irq_alloc_generic_chip() call irq_setup_generic_chip() too. To simplify the cleanup provide a function that both removes a generic chip and frees its memory. Signed-off-by: Bartosz Golaszewski Signed-off-by: Thomas Gleixner Acked-by: Marc Zyngier Cc: linux-doc@vger.kernel.org Cc: Jonathan Corbet Link: http://lkml.kernel.org/r/1496246820-13250-3-git-send-email-brgl@bgdev.pl --- diff --git a/include/linux/irq.h b/include/linux/irq.h index 2c957fe5d9d7..dc63aa10ce70 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -979,6 +979,14 @@ static inline void irq_free_generic_chip(struct irq_chip_generic *gc) kfree(gc); } +static inline void irq_destroy_generic_chip(struct irq_chip_generic *gc, + u32 msk, unsigned int clr, + unsigned int set) +{ + irq_remove_generic_chip(gc, msk, clr, set); + irq_free_generic_chip(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);