lkml.org 
[lkml]   [2019]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] thermal: st: Use devm_platform_ioremap_resource() in st_mmap_regmap_init()
On Wed, Sep 18, 2019 at 12:43 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.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@users.sourceforge.net>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
> 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
>

\
 
 \ /
  Last update: 2019-09-25 16:26    [W:0.107 / U:4.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site