]> git.baikalelectronics.ru Git - kernel.git/commitdiff
can: sja1000: sp_probe(): use platform_get_irq() to get the interrupt
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tue, 21 Dec 2021 20:00:16 +0000 (20:00 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 5 Jan 2022 11:08:46 +0000 (12:08 +0100)
It is preferred that drivers use platform_get_irq() instead of
irq_of_parse_and_map(), so replace.

Link: https://lore.kernel.org/all/20211221200016.13459-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/sja1000/sja1000_platform.c

index d7c2ec529b8f131f34f7e9bd5c93dc8e3dc8929a..f9ec7bd8dfac05ccde05cd4afeb53b674f83f270 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
-#include <linux/of_irq.h>
 
 #include "sja1000.h"
 
@@ -234,13 +233,15 @@ static int sp_probe(struct platform_device *pdev)
        if (!addr)
                return -ENOMEM;
 
-       if (of)
-               irq = irq_of_parse_and_map(of, 0);
-       else
+       if (of) {
+               irq = platform_get_irq(pdev, 0);
+               if (irq < 0)
+                       return irq;
+       } else {
                res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-
-       if (!irq && !res_irq)
-               return -ENODEV;
+               if (!res_irq)
+                       return -ENODEV;
+       }
 
        of_id = of_match_device(sp_of_table, &pdev->dev);
        if (of_id && of_id->data) {