summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/grcan.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-09-30 11:49:09 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-11-11 21:58:09 +0100
commit65725aa8829f0042db888c2b7e6cc8f1d79e7131 (patch)
treefcb42ae5a8b6554b14fcce0f2695de9ab9323af7 /drivers/net/can/grcan.c
parentcan: m_can: add support for handling arbitration error (diff)
downloadlinux-65725aa8829f0042db888c2b7e6cc8f1d79e7131.tar.xz
linux-65725aa8829f0042db888c2b7e6cc8f1d79e7131.zip
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: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/grcan.c')
-rw-r--r--drivers/net/can/grcan.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index b8f1f2b69dd3..378200b682fa 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1652,7 +1652,6 @@ exit_free_candev:
static int grcan_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
- struct resource *res;
u32 sysid, ambafreq;
int irq, err;
void __iomem *base;
@@ -1672,8 +1671,7 @@ static int grcan_probe(struct platform_device *ofdev)
goto exit_error;
}
- res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(&ofdev->dev, res);
+ base = devm_platform_ioremap_resource(ofdev, 0);
if (IS_ERR(base)) {
err = PTR_ERR(base);
goto exit_error;