[1/8] nvmem: sunxi_sid: Convert to devm_platform_ioremap_resource()

Message ID 20230706040504.34057-1-frank.li@vivo.com
State New
Headers
Series [1/8] nvmem: sunxi_sid: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 6, 2023, 4:04 a.m. UTC
  Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/nvmem/sunxi_sid.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Jernej Škrabec July 11, 2023, 6:26 p.m. UTC | #1
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 <frank.li@vivo.com>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

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);
  
Srinivas Kandagatla July 13, 2023, 10:05 a.m. UTC | #2
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,
  

Patch

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);