Commit a1a2b712 authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Rob Herring

of/platform: Drop static setup of IRQ resource from DT core

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: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Tested-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220316200633.28974-1-prabhakar.mahadev-lad.rj@bp.renesas.com
parent 7a150b0d
...@@ -114,35 +114,31 @@ struct platform_device *of_device_alloc(struct device_node *np, ...@@ -114,35 +114,31 @@ struct platform_device *of_device_alloc(struct device_node *np,
struct device *parent) struct device *parent)
{ {
struct platform_device *dev; struct platform_device *dev;
int rc, i, num_reg = 0, num_irq; int rc, i, num_reg = 0;
struct resource *res, temp_res; struct resource *res, temp_res;
dev = platform_device_alloc("", PLATFORM_DEVID_NONE); dev = platform_device_alloc("", PLATFORM_DEVID_NONE);
if (!dev) if (!dev)
return NULL; return NULL;
/* count the io and irq resources */ /* count the io resources */
while (of_address_to_resource(np, num_reg, &temp_res) == 0) while (of_address_to_resource(np, num_reg, &temp_res) == 0)
num_reg++; num_reg++;
num_irq = of_irq_count(np);
/* Populate the resource table */ /* Populate the resource table */
if (num_irq || num_reg) { if (num_reg) {
res = kcalloc(num_irq + num_reg, sizeof(*res), GFP_KERNEL); res = kcalloc(num_reg, sizeof(*res), GFP_KERNEL);
if (!res) { if (!res) {
platform_device_put(dev); platform_device_put(dev);
return NULL; return NULL;
} }
dev->num_resources = num_reg + num_irq; dev->num_resources = num_reg;
dev->resource = res; dev->resource = res;
for (i = 0; i < num_reg; i++, res++) { for (i = 0; i < num_reg; i++, res++) {
rc = of_address_to_resource(np, i, res); rc = of_address_to_resource(np, i, res);
WARN_ON(rc); 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); dev->dev.of_node = of_node_get(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment