public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Bartosz Golaszewski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: marc.zyngier@arm.com, mingo@kernel.org,
	linux-kernel@vger.kernel.org, tglx@linutronix.de, corbet@lwn.net,
	hpa@zytor.com, brgl@bgdev.pl
Subject: [tip:irq/core] irq/generic-chip: Provide irq_free_generic_chip()
Date: Wed, 21 Jun 2017 06:58:45 -0700	[thread overview]
Message-ID: <tip-707188f5f2421a304324e6ef3aaf4413cfab0f3d@git.kernel.org> (raw)
In-Reply-To: <1496246820-13250-2-git-send-email-brgl@bgdev.pl>

Commit-ID:  707188f5f2421a304324e6ef3aaf4413cfab0f3d
Gitweb:     http://git.kernel.org/tip/707188f5f2421a304324e6ef3aaf4413cfab0f3d
Author:     Bartosz Golaszewski <brgl@bgdev.pl>
AuthorDate: Wed, 31 May 2017 18:06:56 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 21 Jun 2017 15:53:10 +0200

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

---
 include/linux/irq.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 94d1ad6..2c957fe 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);

  parent reply	other threads:[~2017-06-21 14:02 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-bot for Bartosz Golaszewski [this message]
2017-05-31 16:06 ` [PATCH 2/5] irq: generic-chip: provide irq_destroy_generic_chip() Bartosz Golaszewski
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=tip-707188f5f2421a304324e6ef3aaf4413cfab0f3d@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=brgl@bgdev.pl \
    --cc=corbet@lwn.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mingo@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox