[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHLCerNQ4G43O0PM71V6tFSS11oxAGNJEkR0A44CCgRjWfgaag@mail.gmail.com>
Date: Wed, 25 Sep 2019 07:25:53 -0700
From: Amit Kucheria <amit.kucheria@...durent.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Linux PM list <linux-pm@...r.kernel.org>,
Allison Randal <allison@...utok.net>,
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>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Himanshu Jha <himanshujha199640@...il.com>
Subject: Re: [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@....de> wrote:
>
> 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>
Reviewed-by: Amit Kucheria <amit.kucheria@...aro.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
>
Powered by blists - more mailing lists