[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <27c67867-d39e-a5c1-12aa-a1e6ba6e7c32@web.de>
Date: Wed, 18 Sep 2019 21:43:19 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-pm@...r.kernel.org, Allison Randal <allison@...utok.net>,
Amit Kucheria <amit.kucheria@...durent.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Eduardo Valentin <edubezval@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Zhang Rui <rui.zhang@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Himanshu Jha <himanshujha199640@...il.com>
Subject: [PATCH] thermal: st: Use devm_platform_ioremap_resource() in
st_mmap_regmap_init()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 18 Sep 2019 21:32:14 +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@...rs.sourceforge.net>
---
drivers/thermal/st/st_thermal_memmap.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c
index a824b78dabf8..d8ff46abd8eb 100644
--- a/drivers/thermal/st/st_thermal_memmap.c
+++ b/drivers/thermal/st/st_thermal_memmap.c
@@ -121,15 +121,8 @@ static int st_mmap_regmap_init(struct st_thermal_sensor *sensor)
{
struct device *dev = sensor->dev;
struct platform_device *pdev = to_platform_device(dev);
- struct resource *res;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "no memory resources defined\n");
- return -ENODEV;
- }
-
- sensor->mmio_base = devm_ioremap_resource(dev, res);
+ sensor->mmio_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(sensor->mmio_base)) {
dev_err(dev, "failed to remap IO\n");
return PTR_ERR(sensor->mmio_base);
--
2.23.0
Powered by blists - more mailing lists