Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <[email protected]>
---
drivers/nvmem/sunxi_sid.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c
index a970f1741cc6..6bfe02ab169a 100644
--- a/drivers/nvmem/sunxi_sid.c
+++ b/drivers/nvmem/sunxi_sid.c
@@ -125,7 +125,6 @@ static int sun8i_sid_read_by_reg(void *context, unsigned int offset,
static int sunxi_sid_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct resource *res;
struct nvmem_config *nvmem_cfg;
struct nvmem_device *nvmem;
struct sunxi_sid *sid;
@@ -142,8 +141,7 @@ static int sunxi_sid_probe(struct platform_device *pdev)
return -EINVAL;
sid->value_offset = cfg->value_offset;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- sid->base = devm_ioremap_resource(dev, res);
+ sid->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(sid->base))
return PTR_ERR(sid->base);
--
2.39.0
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <[email protected]>
---
drivers/nvmem/rockchip-efuse.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c
index e4579de5d014..4004c5bece42 100644
--- a/drivers/nvmem/rockchip-efuse.c
+++ b/drivers/nvmem/rockchip-efuse.c
@@ -267,8 +267,7 @@ static int rockchip_efuse_probe(struct platform_device *pdev)
if (!efuse)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- efuse->base = devm_ioremap_resource(dev, res);
+ efuse->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(efuse->base))
return PTR_ERR(efuse->base);
--
2.39.0
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <[email protected]>
---
drivers/nvmem/uniphier-efuse.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c
index aca910b3b6f8..0a1dbb80537e 100644
--- a/drivers/nvmem/uniphier-efuse.c
+++ b/drivers/nvmem/uniphier-efuse.c
@@ -41,8 +41,7 @@ static int uniphier_efuse_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->base = devm_ioremap_resource(dev, res);
+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
--
2.39.0
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <[email protected]>
---
drivers/nvmem/brcm_nvram.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/nvmem/brcm_nvram.c b/drivers/nvmem/brcm_nvram.c
index 4567c597c87f..9737104f3b76 100644
--- a/drivers/nvmem/brcm_nvram.c
+++ b/drivers/nvmem/brcm_nvram.c
@@ -159,8 +159,7 @@ static int brcm_nvram_probe(struct platform_device *pdev)
return -ENOMEM;
priv->dev = dev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->base = devm_ioremap_resource(dev, res);
+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
--
2.39.0
Am Donnerstag, 6. Juli 2023, 06:05:01 CEST schrieb Yangtao Li:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <[email protected]>
Reviewed-by: Heiko Stuebner <[email protected]>
Dne četrtek, 06. julij 2023 ob 06:04:57 CEST je Yangtao Li napisal(a):
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <[email protected]>
Acked-by: Jernej Skrabec <[email protected]>
Best regards,
Jernej
> ---
> drivers/nvmem/sunxi_sid.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c
> index a970f1741cc6..6bfe02ab169a 100644
> --- a/drivers/nvmem/sunxi_sid.c
> +++ b/drivers/nvmem/sunxi_sid.c
> @@ -125,7 +125,6 @@ static int sun8i_sid_read_by_reg(void *context, unsigned
> int offset, static int sunxi_sid_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> - struct resource *res;
> struct nvmem_config *nvmem_cfg;
> struct nvmem_device *nvmem;
> struct sunxi_sid *sid;
> @@ -142,8 +141,7 @@ static int sunxi_sid_probe(struct platform_device *pdev)
> return -EINVAL;
> sid->value_offset = cfg->value_offset;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - sid->base = devm_ioremap_resource(dev, res);
> + sid->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(sid->base))
> return PTR_ERR(sid->base);
On Thu, 06 Jul 2023 12:04:57 +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
>
Applied, thanks!
[1/8] nvmem: sunxi_sid: Convert to devm_platform_ioremap_resource()
commit: e4ccbdc5f82463e014b6b9072f206f80326e61e9
[2/8] nvmem: brcm_nvram: Use devm_platform_get_and_ioremap_resource()
commit: 37bda099309f2c7c5a75113f43baf1ec3feeee14
[3/8] nvmem: lpc18xx_otp: Convert to devm_platform_ioremap_resource()
commit: 8584695d9ad95246e79d3470f97f16578eb3c2f0
[4/8] nvmem: meson-mx-efuse: Convert to devm_platform_ioremap_resource()
commit: b12a4928e60f0e683b1a8ccd317031de23a1679f
[5/8] nvmem: rockchip-efuse: Use devm_platform_get_and_ioremap_resource()
commit: c169b0d3f79a2c26cbb1233948ea374b7b7c8ec6
[6/8] nvmem: stm32-romem: Use devm_platform_get_and_ioremap_resource()
commit: 0d7713aa08dbd96d37f1fc33610b2cfcff87fed2
[7/8] nvmem: qfprom: do some cleanup
commit: 4156cae2936605e982ad671d1078d41edf79875b
[8/8] nvmem: uniphier: Use devm_platform_get_and_ioremap_resource()
commit: 17340c6c425fd0c29c75ee682742258955515a33
Best regards,
--
Srinivas Kandagatla <[email protected]>