All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Jiang Liu <jiang.liu@linux.intel.com>,
	Jason Cooper <jason@lakedaemon.net>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Tomasz Nowicki <tomasz.nowicki@linaro.org>,
	Hanjun Guo <hanjun.guo@linaro.org>,
	Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
	Graeme Gregory <graeme@xora.org.uk>,
	Jake Oshins <jakeo@microsoft.com>
Subject: [PATCH 02/16] irqdomain: Convert irqdomain->of_node to fwnode
Date: Tue,  6 Oct 2015 18:36:15 +0100	[thread overview]
Message-ID: <1444152989-31726-3-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1444152989-31726-1-git-send-email-marc.zyngier@arm.com>

Now that we have everyone accessing the of_node field via the
irq_domain_get_of_node accessor, it is pretty easy to swap it
for a pointer to a fwnode_handle.

This translates into a few limited changes in __irq_domain_add,
and an updated irq_domain_get_of_node.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 include/linux/irqdomain.h | 5 +++--
 kernel/irq/irqdomain.c    | 6 +++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index f644fdb..2f508f4 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -34,6 +34,7 @@
 
 #include <linux/types.h>
 #include <linux/irqhandler.h>
+#include <linux/of.h>
 #include <linux/radix-tree.h>
 
 struct device_node;
@@ -130,7 +131,7 @@ struct irq_domain {
 	unsigned int flags;
 
 	/* Optional data */
-	struct device_node *of_node;
+	struct fwnode_handle *fwnode;
 	enum irq_domain_bus_token bus_token;
 	struct irq_domain_chip_generic *gc;
 #ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY
@@ -163,7 +164,7 @@ enum {
 
 static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
 {
-	return d->of_node;
+	return to_of_node(d->fwnode);
 }
 
 #ifdef CONFIG_IRQ_DOMAIN
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 8f8b538..1aee5c1 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -46,17 +46,21 @@ struct irq_domain *__irq_domain_add(struct device_node *of_node, int size,
 				    void *host_data)
 {
 	struct irq_domain *domain;
+	struct fwnode_handle *fwnode;
 
 	domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
 			      GFP_KERNEL, of_node_to_nid(of_node));
 	if (WARN_ON(!domain))
 		return NULL;
 
+	of_node_get(of_node);
+	fwnode = of_node ? &of_node->fwnode : NULL;
+
 	/* Fill structure */
 	INIT_RADIX_TREE(&domain->revmap_tree, GFP_KERNEL);
 	domain->ops = ops;
 	domain->host_data = host_data;
-	domain->of_node = of_node_get(of_node);
+	domain->fwnode = fwnode;
 	domain->hwirq_max = hwirq_max;
 	domain->revmap_size = size;
 	domain->revmap_direct_max_irq = direct_max;
-- 
2.1.4

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <marc.zyngier@arm.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Jiang Liu <jiang.liu@linux.intel.com>,
	Jason Cooper <jason@lakedaemon.net>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: <linux-acpi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Tomasz Nowicki <tomasz.nowicki@linaro.org>,
	Hanjun Guo <hanjun.guo@linaro.org>,
	Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
	Graeme Gregory <graeme@xora.org.uk>,
	Jake Oshins <jakeo@microsoft.com>
Subject: [PATCH 02/16] irqdomain: Convert irqdomain->of_node to fwnode
Date: Tue,  6 Oct 2015 18:36:15 +0100	[thread overview]
Message-ID: <1444152989-31726-3-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1444152989-31726-1-git-send-email-marc.zyngier@arm.com>

Now that we have everyone accessing the of_node field via the
irq_domain_get_of_node accessor, it is pretty easy to swap it
for a pointer to a fwnode_handle.

This translates into a few limited changes in __irq_domain_add,
and an updated irq_domain_get_of_node.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 include/linux/irqdomain.h | 5 +++--
 kernel/irq/irqdomain.c    | 6 +++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index f644fdb..2f508f4 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -34,6 +34,7 @@
 
 #include <linux/types.h>
 #include <linux/irqhandler.h>
+#include <linux/of.h>
 #include <linux/radix-tree.h>
 
 struct device_node;
@@ -130,7 +131,7 @@ struct irq_domain {
 	unsigned int flags;
 
 	/* Optional data */
-	struct device_node *of_node;
+	struct fwnode_handle *fwnode;
 	enum irq_domain_bus_token bus_token;
 	struct irq_domain_chip_generic *gc;
 #ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY
@@ -163,7 +164,7 @@ enum {
 
 static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
 {
-	return d->of_node;
+	return to_of_node(d->fwnode);
 }
 
 #ifdef CONFIG_IRQ_DOMAIN
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 8f8b538..1aee5c1 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -46,17 +46,21 @@ struct irq_domain *__irq_domain_add(struct device_node *of_node, int size,
 				    void *host_data)
 {
 	struct irq_domain *domain;
+	struct fwnode_handle *fwnode;
 
 	domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
 			      GFP_KERNEL, of_node_to_nid(of_node));
 	if (WARN_ON(!domain))
 		return NULL;
 
+	of_node_get(of_node);
+	fwnode = of_node ? &of_node->fwnode : NULL;
+
 	/* Fill structure */
 	INIT_RADIX_TREE(&domain->revmap_tree, GFP_KERNEL);
 	domain->ops = ops;
 	domain->host_data = host_data;
-	domain->of_node = of_node_get(of_node);
+	domain->fwnode = fwnode;
 	domain->hwirq_max = hwirq_max;
 	domain->revmap_size = size;
 	domain->revmap_direct_max_irq = direct_max;
-- 
2.1.4


WARNING: multiple messages have this Message-ID (diff)
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/16] irqdomain: Convert irqdomain->of_node to fwnode
Date: Tue,  6 Oct 2015 18:36:15 +0100	[thread overview]
Message-ID: <1444152989-31726-3-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1444152989-31726-1-git-send-email-marc.zyngier@arm.com>

Now that we have everyone accessing the of_node field via the
irq_domain_get_of_node accessor, it is pretty easy to swap it
for a pointer to a fwnode_handle.

This translates into a few limited changes in __irq_domain_add,
and an updated irq_domain_get_of_node.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 include/linux/irqdomain.h | 5 +++--
 kernel/irq/irqdomain.c    | 6 +++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index f644fdb..2f508f4 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -34,6 +34,7 @@
 
 #include <linux/types.h>
 #include <linux/irqhandler.h>
+#include <linux/of.h>
 #include <linux/radix-tree.h>
 
 struct device_node;
@@ -130,7 +131,7 @@ struct irq_domain {
 	unsigned int flags;
 
 	/* Optional data */
-	struct device_node *of_node;
+	struct fwnode_handle *fwnode;
 	enum irq_domain_bus_token bus_token;
 	struct irq_domain_chip_generic *gc;
 #ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY
@@ -163,7 +164,7 @@ enum {
 
 static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d)
 {
-	return d->of_node;
+	return to_of_node(d->fwnode);
 }
 
 #ifdef CONFIG_IRQ_DOMAIN
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 8f8b538..1aee5c1 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -46,17 +46,21 @@ struct irq_domain *__irq_domain_add(struct device_node *of_node, int size,
 				    void *host_data)
 {
 	struct irq_domain *domain;
+	struct fwnode_handle *fwnode;
 
 	domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size),
 			      GFP_KERNEL, of_node_to_nid(of_node));
 	if (WARN_ON(!domain))
 		return NULL;
 
+	of_node_get(of_node);
+	fwnode = of_node ? &of_node->fwnode : NULL;
+
 	/* Fill structure */
 	INIT_RADIX_TREE(&domain->revmap_tree, GFP_KERNEL);
 	domain->ops = ops;
 	domain->host_data = host_data;
-	domain->of_node = of_node_get(of_node);
+	domain->fwnode = fwnode;
 	domain->hwirq_max = hwirq_max;
 	domain->revmap_size = size;
 	domain->revmap_direct_max_irq = direct_max;
-- 
2.1.4

  parent reply	other threads:[~2015-10-06 17:36 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 17:36 [PATCH 00/16] Divorcing irqdomain and device_node Marc Zyngier
2015-10-06 17:36 ` Marc Zyngier
2015-10-06 17:36 ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 01/16] irqdomain: Use an accessor for the of_node field Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-09 14:24   ` Thomas Gleixner
2015-10-09 14:24     ` Thomas Gleixner
2015-10-09 14:31     ` Marc Zyngier
2015-10-09 14:31       ` Marc Zyngier
2015-10-12  6:04   ` Hanjun Guo
2015-10-12  6:04     ` Hanjun Guo
2015-10-12  9:30     ` Marc Zyngier
2015-10-12  9:30       ` Marc Zyngier
2015-10-06 17:36 ` Marc Zyngier [this message]
2015-10-06 17:36   ` [PATCH 02/16] irqdomain: Convert irqdomain->of_node to fwnode Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 03/16] irqdomain: Allow irq domain lookup by fwnode Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 18:31   ` Suravee Suthikulpanit
2015-10-12 18:31     ` Suravee Suthikulpanit
2015-10-12 18:31     ` Suravee Suthikulpanit
2015-10-13  7:35     ` Marc Zyngier
2015-10-13  7:35       ` Marc Zyngier
2015-10-13  7:35       ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 04/16] irqdomain: Introduce a firmware-specific IRQ specifier structure Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 05/16] irqchip: Convert all alloc/xlate users from of_node to fwnode Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12  6:44   ` Hanjun Guo
2015-10-12  6:44     ` Hanjun Guo
2015-10-06 17:36 ` [PATCH 06/16] irqdomain: Introduce irq_create_fwspec_mapping Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 07/16] irqdomain: Introduce irq_domain_create_{linear,tree} Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 08/16] irqdomain: Add a fwnode_handle allocator Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:32   ` Rafael J. Wysocki
2015-10-12 20:32     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 09/16] acpi/gsi: Always perform an irq domain lookup Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:34   ` Rafael J. Wysocki
2015-10-12 20:34     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 10/16] acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:36   ` Rafael J. Wysocki
2015-10-12 20:36     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 11/16] irqchip/gic: Get rid of gic_init_bases() Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 12/16] irqchip/gic: Switch ACPI support to stacked domains Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 13/16] irqchip/gic: Kill the xlate method Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 14/16] acpi/gsi: Cleanup acpi_register_gsi Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-12 20:37   ` Rafael J. Wysocki
2015-10-12 20:37     ` Rafael J. Wysocki
2015-10-06 17:36 ` [PATCH 15/16] irqdomain: Introduce irq_domain_create_hierarchy Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36 ` [PATCH 16/16] irqdomain/msi: Use fwnode instead of of_node Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-06 17:36   ` Marc Zyngier
2015-10-11 21:01 ` [PATCH 00/16] Divorcing irqdomain and device_node Thomas Gleixner
2015-10-11 21:01   ` Thomas Gleixner
2015-10-12  2:40   ` Hanjun Guo
2015-10-12  2:40     ` Hanjun Guo
2015-10-12  7:09     ` Hanjun Guo
2015-10-12  7:09       ` Hanjun Guo
2015-10-12 10:31   ` Marc Zyngier
2015-10-12 10:31     ` Marc Zyngier
2015-10-12 20:38   ` Rafael J. Wysocki
2015-10-12 20:38     ` Rafael J. Wysocki
2015-10-13  8:24     ` Marc Zyngier
2015-10-13  8:24       ` 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=1444152989-31726-3-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=graeme@xora.org.uk \
    --cc=hanjun.guo@linaro.org \
    --cc=jakeo@microsoft.com \
    --cc=jason@lakedaemon.net \
    --cc=jiang.liu@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tomasz.nowicki@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.