a0874f73d15c1fc04d5b37400423bfd6977e3ecd
[openwrt/staging/thess.git] /
1 From 1dc552fa33cf98af3e784dbc0500da93cae3b24a Mon Sep 17 00:00:00 2001
2 From: Yang Li <yang.lee@linux.alibaba.com>
3 Date: Tue, 4 Apr 2023 18:21:38 +0100
4 Subject: [PATCH] nvmem: bcm-ocotp: Use devm_platform_ioremap_resource()
5
6 According to commit 7945f929f1a7 ("drivers: provide
7 devm_platform_ioremap_resource()"), convert platform_get_resource(),
8 devm_ioremap_resource() to a single call to use
9 devm_platform_ioremap_resource(), as this is exactly what this function
10 does.
11
12 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
13 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
14 Link: https://lore.kernel.org/r/20230404172148.82422-31-srinivas.kandagatla@linaro.org
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 ---
17 drivers/nvmem/bcm-ocotp.c | 4 +---
18 1 file changed, 1 insertion(+), 3 deletions(-)
19
20 --- a/drivers/nvmem/bcm-ocotp.c
21 +++ b/drivers/nvmem/bcm-ocotp.c
22 @@ -254,7 +254,6 @@ MODULE_DEVICE_TABLE(acpi, bcm_otpc_acpi_
23 static int bcm_otpc_probe(struct platform_device *pdev)
24 {
25 struct device *dev = &pdev->dev;
26 - struct resource *res;
27 struct otpc_priv *priv;
28 struct nvmem_device *nvmem;
29 int err;
30 @@ -269,8 +268,7 @@ static int bcm_otpc_probe(struct platfor
31 return -ENODEV;
32
33 /* Get OTP base address register. */
34 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
35 - priv->base = devm_ioremap_resource(dev, res);
36 + priv->base = devm_platform_ioremap_resource(pdev, 0);
37 if (IS_ERR(priv->base)) {
38 dev_err(dev, "unable to map I/O memory\n");
39 return PTR_ERR(priv->base);