* [PATCH] Input: apbps2: Simplify resource mapping and IRQ retrieval
@ 2026-06-03 19:24 Rosen Penev
2026-06-06 21:01 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-06-03 19:24 UTC (permalink / raw)
To: linux-input; +Cc: Dmitry Torokhov, open list
Simplify resource mapping by using devm_platform_ioremap_resource()
instead of the longer devm_platform_get_and_ioremap_resource() helper
as the last argument is NULL.
Additionally, use platform_get_irq() to retrieve the interrupt
instead of irq_of_parse_and_map() and propagate its error code on
failure. irq_of_parse_and_map() requires irq_dispose_mapping, which is
missing.
Assisted-by: Antigravity:Gemini-3.5-Flash
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/input/serio/apbps2.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c
index 0aa4ab00af35..5f21acdd4113 100644
--- a/drivers/input/serio/apbps2.c
+++ b/drivers/input/serio/apbps2.c
@@ -140,7 +140,7 @@ static int apbps2_of_probe(struct platform_device *ofdev)
}
/* Find device address */
- priv->regs = devm_platform_get_and_ioremap_resource(ofdev, 0, NULL);
+ priv->regs = devm_platform_ioremap_resource(ofdev, 0);
if (IS_ERR(priv->regs))
return PTR_ERR(priv->regs);
@@ -148,7 +148,10 @@ static int apbps2_of_probe(struct platform_device *ofdev)
iowrite32be(0, &priv->regs->ctrl);
/* IRQ */
- irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
+ irq = platform_get_irq(ofdev, 0);
+ if (irq < 0)
+ return irq;
+
err = devm_request_irq(&ofdev->dev, irq, apbps2_isr,
IRQF_SHARED, "apbps2", priv);
if (err) {
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Input: apbps2: Simplify resource mapping and IRQ retrieval
2026-06-03 19:24 [PATCH] Input: apbps2: Simplify resource mapping and IRQ retrieval Rosen Penev
@ 2026-06-06 21:01 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2026-06-06 21:01 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-input, open list
On Wed, Jun 03, 2026 at 12:24:15PM -0700, Rosen Penev wrote:
> Simplify resource mapping by using devm_platform_ioremap_resource()
> instead of the longer devm_platform_get_and_ioremap_resource() helper
> as the last argument is NULL.
>
> Additionally, use platform_get_irq() to retrieve the interrupt
> instead of irq_of_parse_and_map() and propagate its error code on
> failure. irq_of_parse_and_map() requires irq_dispose_mapping, which is
> missing.
>
> Assisted-by: Antigravity:Gemini-3.5-Flash
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-06 21:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03 19:24 [PATCH] Input: apbps2: Simplify resource mapping and IRQ retrieval Rosen Penev
2026-06-06 21:01 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox