[PATCH v1 2/2] irqdomain: Remove stray '-' in the IRQ domain name
From: Andy Shevchenko
Date: Mon Aug 12 2024 - 15:31:15 EST
When domain suffix is not supplied the fwnode case (not irqchip-fwnode)
uses alloc_fwnode_name(). This currently unconditionally adds a
separator. Fix the logic to make it conditional and drop stray '-' in
the IRQ domain name.
Fixes: 1e7c05292531 ("irqdomain: Allow giving name suffix for domain")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
kernel/irq/irqdomain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 18d253e10e87..1acc5308fcb7 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -149,9 +149,9 @@ static int alloc_fwnode_name(struct irq_domain *domain, const struct fwnode_hand
char *name;
if (bus_token == DOMAIN_BUS_ANY)
- name = kasprintf(GFP_KERNEL, "%pfw-%s", fwnode, suf);
+ name = kasprintf(GFP_KERNEL, "%pfw%s%s", fwnode, sep, suf);
else
- name = kasprintf(GFP_KERNEL, "%pfw-%s%s%d", fwnode, suf, sep, bus_token);
+ name = kasprintf(GFP_KERNEL, "%pfw%s%s-%d", fwnode, sep, suf, bus_token);
if (!name)
return -ENOMEM;
--
2.43.0.rc1.1336.g36b5255a03ac