Commit 8dab8c65 authored by YueHaibing's avatar YueHaibing Committed by Marc Kleine-Budde

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: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 65725aa8
...@@ -942,13 +942,11 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev) ...@@ -942,13 +942,11 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct net_device *ndev; struct net_device *ndev;
struct ifi_canfd_priv *priv; struct ifi_canfd_priv *priv;
struct resource *res;
void __iomem *addr; void __iomem *addr;
int irq, ret; int irq, ret;
u32 id, rev; u32 id, rev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); addr = devm_platform_ioremap_resource(pdev, 0);
addr = devm_ioremap_resource(dev, res);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (IS_ERR(addr) || irq < 0) if (IS_ERR(addr) || irq < 0)
return -EINVAL; return -EINVAL;
......
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