Skip to content

Commit 10697ee

Browse files
geertuKAGA-KOKO
authored andcommitted
irqchip/gic-v3: Pass #redistributor-regions to gic_of_setup_kvm_info()
The caller of gic_of_setup_kvm_info() already queried DT for the value of the #redistributor-regions property. So just pass this value, instead of doing the DT look-up again in the callee. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/808286a3ac08f60585ae7e2c848e0f9b3cb79cf8.1719912215.git.geert+renesas@glider.be
1 parent 9a58480 commit 10697ee

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/irqchip/irq-gic-v3.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,24 +2190,19 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
21902190
of_node_put(parts_node);
21912191
}
21922192

2193-
static void __init gic_of_setup_kvm_info(struct device_node *node)
2193+
static void __init gic_of_setup_kvm_info(struct device_node *node, u32 nr_redist_regions)
21942194
{
21952195
int ret;
21962196
struct resource r;
2197-
u32 gicv_idx;
21982197

21992198
gic_v3_kvm_info.type = GIC_V3;
22002199

22012200
gic_v3_kvm_info.maint_irq = irq_of_parse_and_map(node, 0);
22022201
if (!gic_v3_kvm_info.maint_irq)
22032202
return;
22042203

2205-
if (of_property_read_u32(node, "#redistributor-regions",
2206-
&gicv_idx))
2207-
gicv_idx = 1;
2208-
2209-
gicv_idx += 3; /* Also skip GICD, GICC, GICH */
2210-
ret = of_address_to_resource(node, gicv_idx, &r);
2204+
/* Also skip GICD, GICC, GICH */
2205+
ret = of_address_to_resource(node, nr_redist_regions + 3, &r);
22112206
if (!ret)
22122207
gic_v3_kvm_info.vcpu = r;
22132208

@@ -2297,7 +2292,7 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare
22972292
gic_populate_ppi_partitions(node);
22982293

22992294
if (static_branch_likely(&supports_deactivate_key))
2300-
gic_of_setup_kvm_info(node);
2295+
gic_of_setup_kvm_info(node, nr_redist_regions);
23012296
return 0;
23022297

23032298
out_unmap_rdist:

0 commit comments

Comments
 (0)