Skip to contentSkip to conversation

rtc: sunplus: use devm_platform_ioremap_resource_byname()

PATCH New [email protected] 1 participant 1 message Mar 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: sunplus: use devm_platform_ioremap_resource_byname()

From: Ye Xingchen <[email protected]>

Convert platform_get_resource_byname(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does.

---
 drivers/rtc/rtc-sunplus.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/rtc/rtc-sunplus.c +1 -2
index 44b8083603c2..f33dc301f301 100644
@@ -235,8 +235,7 @@ static int sp_rtc_probe(struct platform_device *plat_dev)
 	if (!sp_rtc)
 		return -ENOMEM;
 
-	sp_rtc->res = platform_get_resource_byname(plat_dev, IORESOURCE_MEM, RTC_REG_NAME);
-	sp_rtc->reg_base = devm_ioremap_resource(&plat_dev->dev, sp_rtc->res);
+	sp_rtc->reg_base = devm_platform_ioremap_resource_byname(plat_dev, RTC_REG_NAME);
 	if (IS_ERR(sp_rtc->reg_base))
 		return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
 					    "%s devm_ioremap_resource fail\n", RTC_REG_NAME);
Signature · 1 line
2.25.1