mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pinctrl: samsung: exynos: replace irq_of_parse_and_map with modern APIs
@ 2026-07-27 19:48 Rosen Penev
  2026-07-28  6:05 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2026-07-27 19:48 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Krzysztof Kozlowski, Sylwester Nawrocki, Peter Griffin,
	Alim Akhtar, Linus Walleij,
	moderated list:PIN CONTROLLER - SAMSUNG,
	open list:PIN CONTROL SUBSYSTEM, open list

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.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/pinctrl/samsung/pinctrl-exynos.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index 81fe0b08a9af..5bef230f5bed 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -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);
-- 
2.55.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: samsung: exynos: replace irq_of_parse_and_map with modern APIs
  2026-07-27 19:48 [PATCH] pinctrl: samsung: exynos: replace irq_of_parse_and_map with modern APIs Rosen Penev
@ 2026-07-28  6:05 ` Krzysztof Kozlowski
  2026-07-29 21:03   ` Rosen Penev
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-28  6:05 UTC (permalink / raw)
  To: Rosen Penev, linux-samsung-soc
  Cc: Sylwester Nawrocki, Peter Griffin, Alim Akhtar, Linus Walleij,
	moderated list:PIN CONTROLLER - SAMSUNG,
	open list:PIN CONTROL SUBSYSTEM, open list

On 27/07/2026 21:48, Rosen Penev wrote:
> 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.

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

But why?


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: samsung: exynos: replace irq_of_parse_and_map with modern APIs
  2026-07-28  6:05 ` Krzysztof Kozlowski
@ 2026-07-29 21:03   ` Rosen Penev
  0 siblings, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2026-07-29 21:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-samsung-soc, Sylwester Nawrocki, Peter Griffin,
	Alim Akhtar, Linus Walleij,
	moderated list:PIN CONTROLLER - SAMSUNG,
	open list:PIN CONTROL SUBSYSTEM, open list

On Mon, Jul 27, 2026 at 11:05 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 27/07/2026 21:48, Rosen Penev wrote:
> > 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.
>
> >
> > 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.
>
>
> Best regards,
> Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-29 21:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-27 19:48 [PATCH] pinctrl: samsung: exynos: replace irq_of_parse_and_map with modern APIs Rosen Penev
2026-07-28  6:05 ` Krzysztof Kozlowski
2026-07-29 21:03   ` Rosen Penev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®