6a4126b9deda99931cc01d1a428f21313432e401
[openwrt/staging/pepe2k.git] /
1 From f5c97da8037b18d1256a58459fa96ed68e50fb41 Mon Sep 17 00:00:00 2001
2 From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
3 Date: Wed, 6 Jul 2022 11:06:27 +0100
4 Subject: [PATCH] nvmem: mtk-efuse: Simplify with
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 No functional changes.
12
13 Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
14 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
15 Link: https://lore.kernel.org/r/20220706100627.6534-8-srinivas.kandagatla@linaro.org
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 ---
18 drivers/nvmem/mtk-efuse.c | 3 +--
19 1 file changed, 1 insertion(+), 2 deletions(-)
20
21 --- a/drivers/nvmem/mtk-efuse.c
22 +++ b/drivers/nvmem/mtk-efuse.c
23 @@ -41,8 +41,7 @@ static int mtk_efuse_probe(struct platfo
24 if (!priv)
25 return -ENOMEM;
26
27 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
28 - priv->base = devm_ioremap_resource(dev, res);
29 + priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
30 if (IS_ERR(priv->base))
31 return PTR_ERR(priv->base);
32