From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752247AbdFUOCM (ORCPT ); Wed, 21 Jun 2017 10:02:12 -0400 Received: from terminus.zytor.com ([65.50.211.136]:38633 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbdFUOCK (ORCPT ); Wed, 21 Jun 2017 10:02:10 -0400 Date: Wed, 21 Jun 2017 06:58:45 -0700 From: tip-bot for Bartosz Golaszewski Message-ID: 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 Reply-To: hpa@zytor.com, brgl@bgdev.pl, corbet@lwn.net, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, marc.zyngier@arm.com In-Reply-To: <1496246820-13250-2-git-send-email-brgl@bgdev.pl> References: <1496246820-13250-2-git-send-email-brgl@bgdev.pl> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] irq/generic-chip: Provide irq_free_generic_chip() Git-Commit-ID: 707188f5f2421a304324e6ef3aaf4413cfab0f3d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 707188f5f2421a304324e6ef3aaf4413cfab0f3d Gitweb: http://git.kernel.org/tip/707188f5f2421a304324e6ef3aaf4413cfab0f3d Author: Bartosz Golaszewski AuthorDate: Wed, 31 May 2017 18:06:56 +0200 Committer: Thomas Gleixner 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 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-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 #include #include +#include #include #include @@ -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);