devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] of/platform: Drop static setup of IRQ resource from DT core
@ 2022-03-16 20:06 Lad Prabhakar
  2022-03-17 12:25 ` Marc Zyngier
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Lad Prabhakar @ 2022-03-16 20:06 UTC (permalink / raw)
  To: Rob Herring, Marc Zyngier, Frank Rowand, devicetree
  Cc: linux-kernel, Prabhakar, linux-renesas-soc, Biju Das,
	Lad Prabhakar

Now that all the DT drivers have switched to platform_get_irq() we can now
safely drop the static setup of IRQ resource from DT core code.

With the above change hierarchical setup of irq domains is no longer
bypassed and thus allowing hierarchical interrupt domains to describe
interrupts using "interrupts" DT property.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
Hi All,

Sending this as RFC as couple of more drivers need to hit -rc yet with
the platform_get_irq() change while that is in progress I wanted to get
some feedback on this patch.

Cheers,
Prabhakar
---
 drivers/of/platform.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 793350028906..6890f7fe556f 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -114,35 +114,31 @@ struct platform_device *of_device_alloc(struct device_node *np,
 				  struct device *parent)
 {
 	struct platform_device *dev;
-	int rc, i, num_reg = 0, num_irq;
+	int rc, i, num_reg = 0;
 	struct resource *res, temp_res;
 
 	dev = platform_device_alloc("", PLATFORM_DEVID_NONE);
 	if (!dev)
 		return NULL;
 
-	/* count the io and irq resources */
+	/* count the io resources */
 	while (of_address_to_resource(np, num_reg, &temp_res) == 0)
 		num_reg++;
-	num_irq = of_irq_count(np);
 
 	/* Populate the resource table */
-	if (num_irq || num_reg) {
-		res = kcalloc(num_irq + num_reg, sizeof(*res), GFP_KERNEL);
+	if (num_reg) {
+		res = kcalloc(num_reg, sizeof(*res), GFP_KERNEL);
 		if (!res) {
 			platform_device_put(dev);
 			return NULL;
 		}
 
-		dev->num_resources = num_reg + num_irq;
+		dev->num_resources = num_reg;
 		dev->resource = res;
 		for (i = 0; i < num_reg; i++, res++) {
 			rc = of_address_to_resource(np, i, res);
 			WARN_ON(rc);
 		}
-		if (of_irq_to_resource_table(np, res, num_irq) != num_irq)
-			pr_debug("not all legacy IRQ resources mapped for %pOFn\n",
-				 np);
 	}
 
 	dev->dev.of_node = of_node_get(np);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-13 18:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-16 20:06 [RFC PATCH] of/platform: Drop static setup of IRQ resource from DT core Lad Prabhakar
2022-03-17 12:25 ` Marc Zyngier
2022-03-31 21:02 ` Rob Herring
2022-04-01  7:41   ` Lad, Prabhakar
2022-04-01 13:06     ` Rob Herring
2022-04-06 13:57 ` Rob Herring
2022-04-06 14:27   ` Lad, Prabhakar
2022-06-11  5:27 ` Yongqin Liu
2022-06-11  8:01   ` Lad, Prabhakar
2022-06-13 12:41     ` Yongqin Liu
2022-06-13 14:15       ` Lad, Prabhakar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).