Skip to contentSkip to conversation

pinctrl: samsung: exynos: replace irq_of_parse_and_map with modern APIs

PATCH In review Rosen Penev 2 participants 3 messages Jul 27 – Jul 29

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: samsung: exynos: replace irq_of_parse_and_map with modern APIs

Replace irq_of_parse_and_map() with fwnode_irq_get() for per-pin IRQ lookup and of_irq_get() for the muxed EINT IRQ. The fwnode-based API works with both OF and ACPI fwnodes and follows modern conventions.

For the muxed EINT path, change the error handling to propagate the error code rather than silently returning 0.

---
 drivers/pinctrl/samsung/pinctrl-exynos.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/pinctrl/samsung/pinctrl-exynos.c +5 -7
index 81fe0b08a9af..5bef230f5bed 100644
@@ -824,8 +824,8 @@ __init int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
 			return -ENOMEM;
 
 		for (idx = 0; idx < bank->nr_pins; ++idx) {
-			irq = irq_of_parse_and_map(to_of_node(bank->fwnode), idx);
-			if (!irq) {
+			irq = fwnode_irq_get(bank->fwnode, idx);
+			if (irq < 0) {
 				dev_err(dev, "irq number for eint-%s-%d not found\n",
 							bank->name, idx);
 				continue;
@@ -841,11 +841,9 @@ __init int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
 	if (!muxed_banks)
 		return 0;
 
-	irq = irq_of_parse_and_map(wkup_np, 0);
-	if (!irq) {
-		dev_err(dev, "irq number for muxed EINTs not found\n");
-		return 0;
-	}
+	irq = of_irq_get(wkup_np, 0);
+	if (irq < 0)
+		return irq;
 
 	muxed_data = devm_kzalloc(dev, sizeof(*muxed_data)
 		+ muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL);
Signature · 1 line
2.55.0
#1 lore raw
Quoted 3 lines · Rosen Penev

Replace irq_of_parse_and_map() with fwnode_irq_get() for per-pin IRQ lookup and of_irq_get() for the muxed EINT IRQ. The fwnode-based API works with both OF and ACPI fwnodes and follows modern conventions.

And what is the point of ACPI here? I see no point in such conversions of one call while leading everything untouched. Add proper ACPI support with valid ACPI tables with ENTIRE driver converted, not one call.

Quoted 3 lines

For the muxed EINT path, change the error handling to propagate the error code rather than silently returning 0.

But why?

Best regards,
Krzysztof

#2 lore raw
Quoted 9 lines · Krzysztof Kozlowski
Quoted 3 lines · Rosen Penev

Replace irq_of_parse_and_map() with fwnode_irq_get() for per-pin IRQ lookup and of_irq_get() for the muxed EINT IRQ. The fwnode-based API works with both OF and ACPI fwnodes and follows modern conventions.

And what is the point of ACPI here? I see no point in such conversions of one call while leading everything untouched. Add proper ACPI support with valid ACPI tables with ENTIRE driver converted, not one call.

Avoids having to call to_of_node. ACPI in the description should be removed.

As far as fwnode is concerned, fwnode APIs are used earlier in the driver, probably for the same reason. fwnode_irq_get didn't exist when this driver was written so of_irq_get + to_of_node made sense.

Quoted 6 lines
Quoted 4 lines

For the muxed EINT path, change the error handling to propagate the error code rather than silently returning 0.

But why?

of_irq_get can return -EPROBE_DEFER.

Quoted 4 lines

Best regards,
Krzysztof