Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220316200633.28974-1-prabhakar.mahadev-lad.rj@bp.renesas.com

authored by

Lad Prabhakar and committed by
Rob Herring
a1a2b712 7a150b0d

+5 -9
+5 -9
drivers/of/platform.c
··· 114 114 struct device *parent) 115 115 { 116 116 struct platform_device *dev; 117 - int rc, i, num_reg = 0, num_irq; 117 + int rc, i, num_reg = 0; 118 118 struct resource *res, temp_res; 119 119 120 120 dev = platform_device_alloc("", PLATFORM_DEVID_NONE); 121 121 if (!dev) 122 122 return NULL; 123 123 124 - /* count the io and irq resources */ 124 + /* count the io resources */ 125 125 while (of_address_to_resource(np, num_reg, &temp_res) == 0) 126 126 num_reg++; 127 - num_irq = of_irq_count(np); 128 127 129 128 /* Populate the resource table */ 130 - if (num_irq || num_reg) { 131 - res = kcalloc(num_irq + num_reg, sizeof(*res), GFP_KERNEL); 129 + if (num_reg) { 130 + res = kcalloc(num_reg, sizeof(*res), GFP_KERNEL); 132 131 if (!res) { 133 132 platform_device_put(dev); 134 133 return NULL; 135 134 } 136 135 137 - dev->num_resources = num_reg + num_irq; 136 + dev->num_resources = num_reg; 138 137 dev->resource = res; 139 138 for (i = 0; i < num_reg; i++, res++) { 140 139 rc = of_address_to_resource(np, i, res); 141 140 WARN_ON(rc); 142 141 } 143 - if (of_irq_to_resource_table(np, res, num_irq) != num_irq) 144 - pr_debug("not all legacy IRQ resources mapped for %pOFn\n", 145 - np); 146 142 } 147 143 148 144 dev->dev.of_node = of_node_get(np);