Commit decdcaee authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Marc Kleine-Budde
Browse files

can: sja1000: sp_probe(): use platform_get_irq() to get the interrupt

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: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent eff104cf
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@
#include <linux/io.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>


#include "sja1000.h"
#include "sja1000.h"


@@ -234,13 +233,15 @@ static int sp_probe(struct platform_device *pdev)
	if (!addr)
	if (!addr)
		return -ENOMEM;
		return -ENOMEM;


	if (of)
	if (of) {
		irq = irq_of_parse_and_map(of, 0);
		irq = platform_get_irq(pdev, 0);
	else
		if (irq < 0)
			return irq;
	} else {
		res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
		res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);

		if (!res_irq)
	if (!irq && !res_irq)
			return -ENODEV;
			return -ENODEV;
	}


	of_id = of_match_device(sp_of_table, &pdev->dev);
	of_id = of_match_device(sp_of_table, &pdev->dev);
	if (of_id && of_id->data) {
	if (of_id && of_id->data) {