All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH 2/5] irq: generic-chip: provide irq_destroy_generic_chip()
Date: Wed, 31 May 2017 18:06:57 +0200	[thread overview]
Message-ID: <1496246820-13250-3-git-send-email-brgl@bgdev.pl> (raw)
In-Reply-To: <1496246820-13250-1-git-send-email-brgl@bgdev.pl>

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

  parent reply	other threads:[~2017-05-31 16:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 16:06 [PATCH 0/5] irq: generic-chip: resource management improvements Bartosz Golaszewski
2017-05-31 16:06 ` [PATCH 1/5] irq: generic-chip: provide irq_free_generic_chip() Bartosz Golaszewski
2017-06-01 18:59   ` kbuild test robot
2017-06-21 13:58   ` [tip:irq/core] irq/generic-chip: Provide irq_free_generic_chip() tip-bot for Bartosz Golaszewski
2017-05-31 16:06 ` Bartosz Golaszewski [this message]
2017-06-21 13:59   ` [tip:irq/core] irq/generic-chip: Provide irq_destroy_generic_chip() tip-bot for Bartosz Golaszewski
2017-05-31 16:06 ` [PATCH 3/5] irq: generic-chip: export irq_init_generic_chip() locally Bartosz Golaszewski
2017-06-21 13:59   ` [tip:irq/core] irq/generic-chip: Export " tip-bot for Bartosz Golaszewski
2017-05-31 16:06 ` [PATCH 4/5] irq: generic-chip: provide devm_irq_alloc_generic_chip() Bartosz Golaszewski
2017-06-21 14:00   ` [tip:irq/core] irq/generic-chip: Provide devm_irq_alloc_generic_chip() tip-bot for Bartosz Golaszewski
2017-05-31 16:07 ` [PATCH 5/5] irq: generic-chip: provide devm_irq_setup_generic_chip() Bartosz Golaszewski
2017-06-21 14:01   ` [tip:irq/core] irq/generic-chip: Provide devm_irq_setup_generic_chip() tip-bot for Bartosz Golaszewski
2017-06-20 10:31 ` [PATCH 0/5] irq: generic-chip: resource management improvements Bartosz Golaszewski
2017-06-20 10:41   ` Marc Zyngier
2017-06-20 10:47     ` Bartosz Golaszewski
2017-06-20 14:14       ` Thomas Gleixner
2017-06-21 10:35         ` Bartosz Golaszewski
2017-06-21 10:42 ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496246820-13250-3-git-send-email-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.