5d88a58073debc63a52c1d631877f926327e46b2
[openwrt/staging/jow.git] /
1 From 9198f241a7205bd85b89bda08fce5c2446a12e23 Mon Sep 17 00:00:00 2001
2 From: Joakim Zhang <qiangqing.zhang@nxp.com>
3 Date: Sun, 29 Sep 2019 08:32:09 +0000
4 Subject: [PATCH] can: flexcan: use devm_platform_ioremap_resource() to
5 simplify code
6
7 Use the new helper devm_platform_ioremap_resource() which wraps the
8 platform_get_resource() and devm_ioremap_resource() together to simplify
9 the code.
10
11 Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
12 Reviewed-by: Sean Nyekjaer <sean@geanix.com>
13 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
14 ---
15 drivers/net/can/flexcan.c | 4 +---
16 1 file changed, 1 insertion(+), 3 deletions(-)
17
18 --- a/drivers/net/can/flexcan.c
19 +++ b/drivers/net/can/flexcan.c
20 @@ -1548,7 +1548,6 @@ static int flexcan_probe(struct platform
21 struct net_device *dev;
22 struct flexcan_priv *priv;
23 struct regulator *reg_xceiver;
24 - struct resource *mem;
25 struct clk *clk_ipg = NULL, *clk_per = NULL;
26 struct flexcan_regs __iomem *regs;
27 int err, irq;
28 @@ -1583,12 +1582,11 @@ static int flexcan_probe(struct platform
29 clock_freq = clk_get_rate(clk_per);
30 }
31
32 - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
33 irq = platform_get_irq(pdev, 0);
34 if (irq <= 0)
35 return -ENODEV;
36
37 - regs = devm_ioremap_resource(&pdev->dev, mem);
38 + regs = devm_platform_ioremap_resource(pdev, 0);
39 if (IS_ERR(regs))
40 return PTR_ERR(regs);
41