bf7a816bb225cc29d240c9bc82a0ef9edd43afeb
[openwrt/staging/thess.git] /
1 From 9ccfcbeb8f32ff89e99b36cb9cdebaa0d1b44ed1 Mon Sep 17 00:00:00 2001
2 From: Yangtao Li <frank.li@vivo.com>
3 Date: Wed, 23 Aug 2023 14:27:24 +0100
4 Subject: [PATCH] nvmem: sunxi_sid: Convert to devm_platform_ioremap_resource()
5
6 Use devm_platform_ioremap_resource() to simplify code.
7
8 Signed-off-by: Yangtao Li <frank.li@vivo.com>
9 Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
10 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11 Link: https://lore.kernel.org/r/20230823132744.350618-3-srinivas.kandagatla@linaro.org
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 drivers/nvmem/sunxi_sid.c | 4 +---
15 1 file changed, 1 insertion(+), 3 deletions(-)
16
17 --- a/drivers/nvmem/sunxi_sid.c
18 +++ b/drivers/nvmem/sunxi_sid.c
19 @@ -125,7 +125,6 @@ static int sun8i_sid_read_by_reg(void *c
20 static int sunxi_sid_probe(struct platform_device *pdev)
21 {
22 struct device *dev = &pdev->dev;
23 - struct resource *res;
24 struct nvmem_config *nvmem_cfg;
25 struct nvmem_device *nvmem;
26 struct sunxi_sid *sid;
27 @@ -142,8 +141,7 @@ static int sunxi_sid_probe(struct platfo
28 return -EINVAL;
29 sid->value_offset = cfg->value_offset;
30
31 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
32 - sid->base = devm_ioremap_resource(dev, res);
33 + sid->base = devm_platform_ioremap_resource(pdev, 0);
34 if (IS_ERR(sid->base))
35 return PTR_ERR(sid->base);
36