rtc: goldfish: Use devm_platform_ioremap_resource() in goldfish_rtc_probe()
Subsystems (3)
PATCH 1/1 rtc: goldfish: Use devm_platform_ioremap_resource() in goldfish_rtc_probe()
From: Markus Elfring <[email protected]>
Date: Sat, 21 Sep 2019 12:20:11 +0200
Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/rtc/rtc-goldfish.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/rtc/rtc-goldfish.c +1 -7
@@ -165,7 +165,6 @@ static const struct rtc_class_ops goldfish_rtc_ops = {static int goldfish_rtc_probe (struct platform_device *pdev) {struct goldfish_rtc *rtcdrv; -struct resource *r;int err; rtcdrv =devm_kzalloc (&pdev->dev,sizeof (*rtcdrv),GFP_KERNEL );
@@ -173,12 +172,7 @@ static int goldfish_rtc_probe(struct platform_device *pdev)return -ENOMEM ;platform_set_drvdata (pdev, rtcdrv); - - r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!r) -return -ENODEV ; - - rtcdrv->base =devm_ioremap_resource (&pdev->dev, r); + rtcdrv->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (rtcdrv->base))return -ENODEV ;
--
2.23.0