18c66cdac529105370ee4a08198e055a26b9140b
[openwrt/staging/jow.git] /
1 From 98204ccafd45a8a6109ff2d60e2c179b95d92578 Mon Sep 17 00:00:00 2001
2 From: ye xingchen <ye.xingchen@zte.com.cn>
3 Date: Thu, 19 Jan 2023 17:19:58 +0800
4 Subject: [PATCH 13/16] i2c: mt65xx: Use
5 devm_platform_get_and_ioremap_resource()
6
7 Convert platform_get_resource(), devm_ioremap_resource() to a single
8 call to devm_platform_get_and_ioremap_resource(), as this is exactly
9 what this function does.
10
11 Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
12 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
13 Signed-off-by: Wolfram Sang <wsa@kernel.org>
14 ---
15 drivers/i2c/busses/i2c-mt65xx.c | 7 ++-----
16 1 file changed, 2 insertions(+), 5 deletions(-)
17
18 --- a/drivers/i2c/busses/i2c-mt65xx.c
19 +++ b/drivers/i2c/busses/i2c-mt65xx.c
20 @@ -1366,20 +1366,17 @@ static int mtk_i2c_probe(struct platform
21 {
22 int ret = 0;
23 struct mtk_i2c *i2c;
24 - struct resource *res;
25 int i, irq, speed_clk;
26
27 i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
28 if (!i2c)
29 return -ENOMEM;
30
31 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
32 - i2c->base = devm_ioremap_resource(&pdev->dev, res);
33 + i2c->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
34 if (IS_ERR(i2c->base))
35 return PTR_ERR(i2c->base);
36
37 - res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
38 - i2c->pdmabase = devm_ioremap_resource(&pdev->dev, res);
39 + i2c->pdmabase = devm_platform_get_and_ioremap_resource(pdev, 1, NULL);
40 if (IS_ERR(i2c->pdmabase))
41 return PTR_ERR(i2c->pdmabase);
42