]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Input: apbps2 - simplify resource mapping and IRQ retrieval
authorRosen Penev <rosenp@gmail.com>
Wed, 3 Jun 2026 19:24:15 +0000 (12:24 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 6 Jun 2026 21:00:34 +0000 (14:00 -0700)
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>
Link: https://patch.msgid.link/20260603192415.6679-1-rosenp@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/serio/apbps2.c

index 0aa4ab00af352bf3eaead3b37ef83084ee5eb568..5f21acdd411394a8691be286d0dd285be460df14 100644 (file)
@@ -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) {