diff mbox series

[6/6] drivers/thermal/ti-soc-thermal: Use devm_platform_get_and_ioremap_resource()

Message ID 20230626124334.15100-6-frank.li@vivo.com
State New
Headers show
Series None | expand

Commit Message

Yangtao Li June 26, 2023, 12:43 p.m. UTC
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 <frank.li@vivo.com>
---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index a1c9a1530183..0066b9150920 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -847,10 +847,9 @@  static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev)
 	do {
 		void __iomem *chunk;
 
-		res = platform_get_resource(pdev, IORESOURCE_MEM, i);
+		chunk = devm_platform_get_and_ioremap_resource(pdev, i, &res);
 		if (!res)
 			break;
-		chunk = devm_ioremap_resource(&pdev->dev, res);
 		if (i == 0)
 			bgp->base = chunk;
 		if (IS_ERR(chunk))