Skip to content

Commit 4304469

Browse files
krzkrobherring
authored andcommitted
irqchip/atmel-aic: Simplify with of_machine_get_match_data()
Replace open-coded getting root OF node, matching against it and getting the match data with new of_machine_get_match_data() helper. Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patch.msgid.link/20251112-b4-of-match-matchine-data-v2-7-d46b72003fd6@linaro.org Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
1 parent f83b427 commit 4304469

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

drivers/irqchip/irq-atmel-aic-common.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,11 @@ void __init aic_common_rtt_irq_fixup(void)
187187

188188
static void __init aic_common_irq_fixup(const struct of_device_id *matches)
189189
{
190-
struct device_node *root = of_find_node_by_path("/");
191-
const struct of_device_id *match;
190+
void (*fixup)(void);
192191

193-
if (!root)
194-
return;
195-
196-
match = of_match_node(matches, root);
197-
198-
if (match) {
199-
void (*fixup)(void) = match->data;
192+
fixup = of_machine_get_match_data(matches);
193+
if (fixup)
200194
fixup();
201-
}
202-
203-
of_node_put(root);
204195
}
205196

206197
struct irq_domain *__init aic_common_of_init(struct device_node *node,

0 commit comments

Comments
 (0)