From: "tip-bot2 for Andy Shevchenko" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Marc Zyngier <maz@kernel.org>, x86 <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [tip: irq/core] irqdomain: Make __irq_domain_add() less OF-dependent
Date: Sat, 30 May 2020 07:46:36 -0000 [thread overview]
Message-ID: <159082479624.17951.12396123200576489042.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200520164927.39090-1-andriy.shevchenko@linux.intel.com>
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 181e9d4efaf6aa8d1e7d510aeb7114c0f276fad7
Gitweb: https://git.kernel.org/tip/181e9d4efaf6aa8d1e7d510aeb7114c0f276fad7
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate: Wed, 20 May 2020 19:49:25 +03:00
Committer: Marc Zyngier <maz@kernel.org>
CommitterDate: Thu, 21 May 2020 10:50:30 +01:00
irqdomain: Make __irq_domain_add() less OF-dependent
__irq_domain_add() relies in some places on the fact that the fwnode
can be only of type OF. This prevents refactoring of the code to support
other types of fwnode. Make it less OF-dependent by switching it
to use the fwnode directly where it makes sense.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200520164927.39090-1-andriy.shevchenko@linux.intel.com
---
kernel/irq/irqdomain.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index e2aa128..7649f38 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -132,14 +132,13 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
const struct irq_domain_ops *ops,
void *host_data)
{
- struct device_node *of_node = to_of_node(fwnode);
struct irqchip_fwid *fwid;
struct irq_domain *domain;
static atomic_t unknown_domains;
domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
- GFP_KERNEL, of_node_to_nid(of_node));
+ GFP_KERNEL, of_node_to_nid(to_of_node(fwnode)));
if (!domain)
return NULL;
@@ -177,15 +176,15 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
domain->fwnode = fwnode;
#endif
- } else if (of_node) {
+ } else if (is_of_node(fwnode)) {
char *name;
/*
- * DT paths contain '/', which debugfs is legitimately
+ * fwnode paths contain '/', which debugfs is legitimately
* unhappy about. Replace them with ':', which does
* the trick and is not as offensive as '\'...
*/
- name = kasprintf(GFP_KERNEL, "%pOF", of_node);
+ name = kasprintf(GFP_KERNEL, "%pfw", fwnode);
if (!name) {
kfree(domain);
return NULL;
@@ -210,7 +209,7 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
domain->flags |= IRQ_DOMAIN_NAME_ALLOCATED;
}
- of_node_get(of_node);
+ fwnode_handle_get(fwnode);
/* Fill structure */
INIT_RADIX_TREE(&domain->revmap_tree, GFP_KERNEL);
@@ -259,7 +258,7 @@ void irq_domain_remove(struct irq_domain *domain)
pr_debug("Removed domain %s\n", domain->name);
- of_node_put(irq_domain_get_of_node(domain));
+ fwnode_handle_put(domain->fwnode);
if (domain->flags & IRQ_DOMAIN_NAME_ALLOCATED)
kfree(domain->name);
kfree(domain);
prev parent reply other threads:[~2020-05-30 7:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 16:49 [PATCH v1 1/3] " Andy Shevchenko
2020-05-20 16:49 ` [PATCH v1 2/3] irqdomain: Get rid of special treatment for ACPI in __irq_domain_add() Andy Shevchenko
2020-05-30 7:46 ` [tip: irq/core] " tip-bot2 for Andy Shevchenko
2020-05-20 16:49 ` [PATCH v1 3/3] irqdomain: Allow software node to be correct one for IRQ domain Andy Shevchenko
2020-05-21 8:59 ` Marc Zyngier
2020-05-21 9:43 ` Andy Shevchenko
2020-05-30 7:46 ` [tip: irq/core] irqdomain: Allow software nodes for IRQ domain creation tip-bot2 for Andy Shevchenko
2020-05-30 7:46 ` tip-bot2 for Andy Shevchenko [this message]
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=159082479624.17951.12396123200576489042.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=maz@kernel.org \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®