* [PATCH] rtc: r7301: Use devm_platform_ioremap_resource() in rtc7301_rtc_probe()
@ 2019-09-21 11:49 Markus Elfring
2019-09-22 2:46 ` Akinobu Mita
0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-21 11:49 UTC (permalink / raw)
To: linux-rtc, Akinobu Mita, Alessandro Zummo, Alexandre Belloni
Cc: LKML, kernel-janitors, Rob Herring
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
drivers/rtc/rtc-r7301.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/rtc/rtc-r7301.c b/drivers/rtc/rtc-r7301.c
index 2498278853af..aaf1b95e3990 100644
--- a/drivers/rtc/rtc-r7301.c
+++ b/drivers/rtc/rtc-r7301.c
@@ -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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rtc: r7301: Use devm_platform_ioremap_resource() in rtc7301_rtc_probe()
2019-09-21 11:49 [PATCH] rtc: r7301: Use devm_platform_ioremap_resource() in rtc7301_rtc_probe() Markus Elfring
@ 2019-09-22 2:46 ` Akinobu Mita
0 siblings, 0 replies; 2+ messages in thread
From: Akinobu Mita @ 2019-09-22 2:46 UTC (permalink / raw)
To: Markus Elfring
Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, LKML,
kernel-janitors, Rob Herring
2019年9月21日(土) 20:49 Markus Elfring <Markus.Elfring@web.de>:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-22 2:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-21 11:49 [PATCH] rtc: r7301: Use devm_platform_ioremap_resource() in rtc7301_rtc_probe() Markus Elfring
2019-09-22 2:46 ` Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®