summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorHerve Codina <herve.codina@bootlin.com>2024-06-14 19:32:02 +0200
committerThomas Gleixner <tglx@linutronix.de>2024-06-17 15:48:12 +0200
commit89b37541ca38954f8ac01c2ca25405b140cfc8eb (patch)
tree619144bafc2c60047fa7572d7f595c62a9cecc7f /kernel
parent6ce3e98184b625d2870991880bf9586ded7ea7f9 (diff)
downloadlinux-stable-89b37541ca38954f8ac01c2ca25405b140cfc8eb.tar.gz
linux-stable-89b37541ca38954f8ac01c2ca25405b140cfc8eb.tar.bz2
linux-stable-89b37541ca38954f8ac01c2ca25405b140cfc8eb.zip
irqdomain: Introduce irq_domain_free()
In preparation of the introduction of the irq domain instantiation, introduce irq_domain_free() to avoid code duplication on later modifications. This new function is an extraction of the current operations performed to free the irq domain. No functional change intended. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Herve Codina <herve.codina@bootlin.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240614173232.1184015-2-herve.codina@bootlin.com
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/irqdomain.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7b4d580fc8e4..40b631bd2836 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -238,6 +238,15 @@ static void __irq_domain_publish(struct irq_domain *domain)
pr_debug("Added domain %s\n", domain->name);
}
+static void irq_domain_free(struct irq_domain *domain)
+{
+ fwnode_dev_initialized(domain->fwnode, false);
+ fwnode_handle_put(domain->fwnode);
+ if (domain->flags & IRQ_DOMAIN_NAME_ALLOCATED)
+ kfree(domain->name);
+ kfree(domain);
+}
+
/**
* __irq_domain_add() - Allocate a new irq_domain data structure
* @fwnode: firmware node for the interrupt controller
@@ -293,12 +302,7 @@ void irq_domain_remove(struct irq_domain *domain)
mutex_unlock(&irq_domain_mutex);
pr_debug("Removed domain %s\n", domain->name);
-
- fwnode_dev_initialized(domain->fwnode, false);
- fwnode_handle_put(domain->fwnode);
- if (domain->flags & IRQ_DOMAIN_NAME_ALLOCATED)
- kfree(domain->name);
- kfree(domain);
+ irq_domain_free(domain);
}
EXPORT_SYMBOL_GPL(irq_domain_remove);