0395bbf8bcef3ee3541c9ee574c0c4cbbf9c4d75
[openwrt/staging/neocturne.git] /
1 From 0b49178e2b6b4aac3c7fa3ce8d8c02208a13b988 Mon Sep 17 00:00:00 2001
2 From: Yangtao Li <frank.li@vivo.com>
3 Date: Wed, 23 Aug 2023 14:27:26 +0100
4 Subject: [PATCH] nvmem: lpc18xx_otp: Convert to
5 devm_platform_ioremap_resource()
6
7 Use devm_platform_ioremap_resource() to simplify code.
8
9 Signed-off-by: Yangtao Li <frank.li@vivo.com>
10 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11 Link: https://lore.kernel.org/r/20230823132744.350618-5-srinivas.kandagatla@linaro.org
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 drivers/nvmem/lpc18xx_otp.c | 4 +---
15 1 file changed, 1 insertion(+), 3 deletions(-)
16
17 --- a/drivers/nvmem/lpc18xx_otp.c
18 +++ b/drivers/nvmem/lpc18xx_otp.c
19 @@ -68,14 +68,12 @@ static int lpc18xx_otp_probe(struct plat
20 {
21 struct nvmem_device *nvmem;
22 struct lpc18xx_otp *otp;
23 - struct resource *res;
24
25 otp = devm_kzalloc(&pdev->dev, sizeof(*otp), GFP_KERNEL);
26 if (!otp)
27 return -ENOMEM;
28
29 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
30 - otp->base = devm_ioremap_resource(&pdev->dev, res);
31 + otp->base = devm_platform_ioremap_resource(pdev, 0);
32 if (IS_ERR(otp->base))
33 return PTR_ERR(otp->base);
34