Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1654393
| From | Bartosz Golaszewski <brgl@bgdev.pl> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/5] irq: generic-chip: provide irq_destroy_generic_chip() |
| Date | 2017-05-31 18:10 +0200 |
| Message-ID | <tNem6-73N-17@gated-at.bofh.it> (permalink) |
| References | <tNem6-73N-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
include/linux/irq.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index cba41a4..a5d298e 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -973,6 +973,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);
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] irq: generic-chip: resource management improvements Bartosz Golaszewski <brgl@bgdev.pl> - 2017-05-31 18:10 +0200 [PATCH 2/5] irq: generic-chip: provide irq_destroy_generic_chip() Bartosz Golaszewski <brgl@bgdev.pl> - 2017-05-31 18:10 +0200 [PATCH 3/5] irq: generic-chip: export irq_init_generic_chip() locally Bartosz Golaszewski <brgl@bgdev.pl> - 2017-05-31 18:10 +0200 [PATCH 1/5] irq: generic-chip: provide irq_free_generic_chip() Bartosz Golaszewski <brgl@bgdev.pl> - 2017-05-31 18:10 +0200 [PATCH 5/5] irq: generic-chip: provide devm_irq_setup_generic_chip() Bartosz Golaszewski <brgl@bgdev.pl> - 2017-05-31 18:10 +0200
csiph-web