diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-10-15 22:20:46 +0800 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-11-11 21:58:09 +0100 |
commit | 8dab8c65d1b519aa6466dbd433b7062382d24ade (patch) | |
tree | ccf2421b2470678ef699cec2650e9a5498df1e07 /drivers/net/can | |
parent | 65725aa8829f0042db888c2b7e6cc8f1d79e7131 (diff) |
can: ifi: 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 <yuehaibing@huawei.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/ifi_canfd/ifi_canfd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c index fedd927ba6ed..04d59bede5ea 100644 --- a/drivers/net/can/ifi_canfd/ifi_canfd.c +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c @@ -942,13 +942,11 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct net_device *ndev; struct ifi_canfd_priv *priv; - struct resource *res; void __iomem *addr; int irq, ret; u32 id, rev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - addr = devm_ioremap_resource(dev, res); + addr = devm_platform_ioremap_resource(pdev, 0); irq = platform_get_irq(pdev, 0); if (IS_ERR(addr) || irq < 0) return -EINVAL; |