diff options
| author | Bartosz Golaszewski <brgl@bgdev.pl> | 2017-05-31 12:06:57 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2017-06-21 09:53:10 -0400 |
| commit | 32bb6cbb3b4ea5ca24e3fa13e11772c192616e04 (patch) | |
| tree | c20749f3f28d745935e737406afc00fab7247128 /include | |
| parent | 707188f5f2421a304324e6ef3aaf4413cfab0f3d (diff) | |
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 <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-3-git-send-email-brgl@bgdev.pl
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/irq.h | 8 |
1 files changed, 8 insertions, 0 deletions
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) | |||
| 979 | kfree(gc); | 979 | kfree(gc); |
| 980 | } | 980 | } |
| 981 | 981 | ||
| 982 | static inline void irq_destroy_generic_chip(struct irq_chip_generic *gc, | ||
| 983 | u32 msk, unsigned int clr, | ||
| 984 | unsigned int set) | ||
| 985 | { | ||
| 986 | irq_remove_generic_chip(gc, msk, clr, set); | ||
| 987 | irq_free_generic_chip(gc); | ||
| 988 | } | ||
| 989 | |||
| 982 | static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) | 990 | static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) |
| 983 | { | 991 | { |
| 984 | return container_of(d->chip, struct irq_chip_type, chip); | 992 | return container_of(d->chip, struct irq_chip_type, chip); |
