diff mbox series

ARM: samsung: Use devm_platform_ioremap_resource() to simplify code

Message ID 20200419070607.15488-1-tangbin@cmss.chinamobile.com (mailing list archive)
State Mainlined
Commit 06b29212c3a2467ef9d25876fe82b77fa3d09ac2
Headers show
Series ARM: samsung: Use devm_platform_ioremap_resource() to simplify code | expand

Commit Message

Tang Bin April 19, 2020, 7:06 a.m. UTC
Use devm_platform_ioremap_resource() instead of
platform_get_resource()+ devm_ioremap_resource().

Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 arch/arm/plat-samsung/adc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Krzysztof Kozlowski April 21, 2020, 9:37 a.m. UTC | #1
On Sun, Apr 19, 2020 at 03:06:07PM +0800, Tang Bin wrote:
> Use devm_platform_ioremap_resource() instead of
> platform_get_resource()+ devm_ioremap_resource().
> 
> Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> ---
>  arch/arm/plat-samsung/adc.c | 4 +---

Thanks, applied.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index 839bf7d5f..55b1925f6 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -333,7 +333,6 @@  static int s3c_adc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct adc_device *adc;
-	struct resource *regs;
 	enum s3c_cpu_type cpu = platform_get_device_id(pdev)->driver_data;
 	int ret;
 	unsigned tmp;
@@ -370,8 +369,7 @@  static int s3c_adc_probe(struct platform_device *pdev)
 		return PTR_ERR(adc->clk);
 	}
 
-	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	adc->regs = devm_ioremap_resource(dev, regs);
+	adc->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(adc->regs))
 		return PTR_ERR(adc->regs);