Commit 65725aa8 authored by YueHaibing's avatar YueHaibing Committed by Marc Kleine-Budde

can: grcan: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarSean Nyekjaer <sean@geanix.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 6b43a265
...@@ -1652,7 +1652,6 @@ static int grcan_setup_netdev(struct platform_device *ofdev, ...@@ -1652,7 +1652,6 @@ static int grcan_setup_netdev(struct platform_device *ofdev,
static int grcan_probe(struct platform_device *ofdev) static int grcan_probe(struct platform_device *ofdev)
{ {
struct device_node *np = ofdev->dev.of_node; struct device_node *np = ofdev->dev.of_node;
struct resource *res;
u32 sysid, ambafreq; u32 sysid, ambafreq;
int irq, err; int irq, err;
void __iomem *base; void __iomem *base;
...@@ -1672,8 +1671,7 @@ static int grcan_probe(struct platform_device *ofdev) ...@@ -1672,8 +1671,7 @@ static int grcan_probe(struct platform_device *ofdev)
goto exit_error; goto exit_error;
} }
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(ofdev, 0);
base = devm_ioremap_resource(&ofdev->dev, res);
if (IS_ERR(base)) { if (IS_ERR(base)) {
err = PTR_ERR(base); err = PTR_ERR(base);
goto exit_error; goto exit_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment