Skip to content

Commit e99ab4a

Browse files
Ye Xingchenalexandrebelloni
authored andcommitted
rtc: armada38x: 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/202303221130316049449@zte.com.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 9168905 commit e99ab4a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/rtc/rtc-armada38x.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ MODULE_DEVICE_TABLE(of, armada38x_rtc_of_match_table);
491491

492492
static __init int armada38x_rtc_probe(struct platform_device *pdev)
493493
{
494-
struct resource *res;
495494
struct armada38x_rtc *rtc;
496495

497496
rtc = devm_kzalloc(&pdev->dev, sizeof(struct armada38x_rtc),
@@ -508,12 +507,10 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)
508507

509508
spin_lock_init(&rtc->lock);
510509

511-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rtc");
512-
rtc->regs = devm_ioremap_resource(&pdev->dev, res);
510+
rtc->regs = devm_platform_ioremap_resource_byname(pdev, "rtc");
513511
if (IS_ERR(rtc->regs))
514512
return PTR_ERR(rtc->regs);
515-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rtc-soc");
516-
rtc->regs_soc = devm_ioremap_resource(&pdev->dev, res);
513+
rtc->regs_soc = devm_platform_ioremap_resource_byname(pdev, "rtc-soc");
517514
if (IS_ERR(rtc->regs_soc))
518515
return PTR_ERR(rtc->regs_soc);
519516

0 commit comments

Comments
 (0)