[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb85caec-d2e3-460b-a9ab-90ef9aacc2ce@collabora.com>
Date: Tue, 6 Feb 2024 10:24:01 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>,
Markus Elfring <Markus.Elfring@....de>
Cc: linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-pm@...r.kernel.org, kernel-janitors@...r.kernel.org,
Heiko Stübner <heiko@...ech.de>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>, Rob Herring <robh@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] pmdomain: mediatek: Use
devm_platform_get_and_ioremap_resource() in init_scp()
Il 05/02/24 17:31, Geert Uytterhoeven ha scritto:
> Hi Markus,
>
> On Mon, Feb 5, 2024 at 3:23 PM Markus Elfring <Markus.Elfring@....de> wrote:
>> From: Markus Elfring <elfring@...rs.sourceforge.net>
>> Date: Mon, 5 Feb 2024 15:08:27 +0100
>>
>> A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
>> ("drivers: provide devm_platform_get_and_ioremap_resource()").
>> Thus reuse existing functionality instead of keeping duplicate source code.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
>
> Thanks for your patch!
>
>> --- a/drivers/pmdomain/mediatek/mtk-scpsys.c
>> +++ b/drivers/pmdomain/mediatek/mtk-scpsys.c
>> @@ -441,8 +441,7 @@ static struct scp *init_scp(struct platform_device *pdev,
>>
>> scp->dev = &pdev->dev;
>>
>> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> - scp->base = devm_ioremap_resource(&pdev->dev, res);
>> + scp->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>
> Given res is further unused, please use devm_platform_ioremap_resource()
> instead, and remove the local variable res.
>
Agreed: res will never be used.
Cheers,
Angelo
Powered by blists - more mailing lists