Skip to content

Commit 9168905

Browse files
Ye Xingchenalexandrebelloni
authored andcommitted
rtc: sunplus: use devm_platform_ioremap_resource_byname()
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. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202303221131581039486@zte.com.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent c7a639d commit 9168905

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/rtc/rtc-sunplus.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ static int sp_rtc_probe(struct platform_device *plat_dev)
235235
if (!sp_rtc)
236236
return -ENOMEM;
237237

238-
sp_rtc->res = platform_get_resource_byname(plat_dev, IORESOURCE_MEM, RTC_REG_NAME);
239-
sp_rtc->reg_base = devm_ioremap_resource(&plat_dev->dev, sp_rtc->res);
238+
sp_rtc->reg_base = devm_platform_ioremap_resource_byname(plat_dev, RTC_REG_NAME);
240239
if (IS_ERR(sp_rtc->reg_base))
241240
return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
242241
"%s devm_ioremap_resource fail\n", RTC_REG_NAME);

0 commit comments

Comments
 (0)