rtc: r7301: Use devm_platform_ioremap_resource() in rtc7301_rtc_probe()
Subsystems (2)
PATCH 1/1 rtc: r7301: Use devm_platform_ioremap_resource() in rtc7301_rtc_probe()
From: Markus Elfring <[email protected]>
Date: Sat, 21 Sep 2019 13:43:07 +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-r7301.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/rtc/rtc-r7301.c +1 -6
@@ -354,21 +354,16 @@ static void rtc7301_init(struct rtc7301_priv *priv)static int __init rtc7301_rtc_probe (struct platform_device *dev) { -struct resource *res;void __iomem *regs;struct rtc7301_priv *priv;struct rtc_device *rtc;int ret; - res =platform_get_resource (dev,IORESOURCE_MEM ,0 ); -if (!res) -return -ENODEV ; - priv =devm_kzalloc (&dev->dev,sizeof (*priv),GFP_KERNEL );if (!priv)return -ENOMEM ; - regs =devm_ioremap_resource (&dev->dev, res); + regs =devm_platform_ioremap_resource (dev,0 );if (IS_ERR (regs))return PTR_ERR (regs);
--
2.23.0
2019年9月21日(土) 20:49 Markus Elfring <[email protected]>:
Quoted 9 lines
From: Markus Elfring <[email protected]>
Date: Sat, 21 Sep 2019 13:43:07 +0200Simplify 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]>
Reviewed-by Akinobu Mita <[email protected]>