From: YueHaibing Date: Tue, 15 Oct 2019 14:27:44 +0000 (+0800) Subject: can: sun4i: use devm_platform_ioremap_resource() to simplify code X-Git-Tag: v5.10.7~3838^2~127^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0767bbe530c123e0945f4c4c60639005ce44fede;p=platform%2Fkernel%2Flinux-rpi.git can: sun4i: use devm_platform_ioremap_resource() to simplify code Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c index f4cd881..e3ba8ab 100644 --- a/drivers/net/can/sun4i_can.c +++ b/drivers/net/can/sun4i_can.c @@ -771,7 +771,6 @@ static int sun4ican_remove(struct platform_device *pdev) static int sun4ican_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - struct resource *mem; struct clk *clk; void __iomem *addr; int err, irq; @@ -791,8 +790,7 @@ static int sun4ican_probe(struct platform_device *pdev) goto exit; } - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - addr = devm_ioremap_resource(&pdev->dev, mem); + addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(addr)) { err = -EBUSY; goto exit;