summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-goldfish.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-21 12:49:01 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-10-06 22:04:51 +0300
commit89576bebbc175711af20107d5484a487ef969cf0 (patch)
tree11c38ebd63cbe239f2617d1357ee1e06bf6e755b /drivers/rtc/rtc-goldfish.c
parenteaa6ef563d1a60fbfe6c128bf8fdb74405035b0c (diff)
downloadlinux-89576bebbc175711af20107d5484a487ef969cf0.tar.xz
rtc: Use devm_platform_ioremap_resource()
Simplify probe by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Link: https://lore.kernel.org/r/4552ef52-f218-93b1-6dfa-668d137676f8@web.de Link: https://lore.kernel.org/r/5ecfcf43-d6b2-1a38-dee8-b8806f30bc83@web.de Link: https://lore.kernel.org/r/25448e11-c43f-9ae0-4c43-6f789accc026@web.de Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Link: https://lore.kernel.org/r/8c17a59c-82ff-aa6b-5653-a38d786d3e83@web.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-goldfish.c')
-rw-r--r--drivers/rtc/rtc-goldfish.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-goldfish.c b/drivers/rtc/rtc-goldfish.c
index 1a3420ee6a4d..cb6b0ad7ec3f 100644
--- a/drivers/rtc/rtc-goldfish.c
+++ b/drivers/rtc/rtc-goldfish.c
@@ -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;