From: Markus Elfring <Markus.Elfring@web.de>
To: "Geert Uytterhoeven" <geert@linux-m68k.org>,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
kernel-janitors@vger.kernel.org,
"Angelo Gioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Heiko Stübner" <heiko@sntech.de>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Rob Herring" <robh@kernel.org>,
"Ulf Hansson" <ulf.hansson@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pmdomain: mediatek: Use devm_platform_get_and_ioremap_resource() in init_scp()
Date: Mon, 5 Feb 2024 18:28:31 +0100 [thread overview]
Message-ID: <8f011126-c95a-4c71-8bc9-a6b0a5823c96@web.de> (raw)
In-Reply-To: <CAMuHMdUxn4Ne7kmEfONz8Uk3Why3m9r83GdM5RzTxm_4Gj_a6g@mail.gmail.com>
>> +++ 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.
I got another idea after looking at the implementation of the function
“devm_platform_get_and_ioremap_resource” once more.
https://elixir.bootlin.com/linux/v6.8-rc3/source/drivers/base/platform.c#L87
It seems that it is supported to pass a null pointer for the last parameter
(while this possibility is not mentioned in the interface description so far).
How do you think about to benefit from such a design option any more
(instead of the determination of a corresponding platform device)?
Regards,
Markus
next prev parent reply other threads:[~2024-02-05 17:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 14:23 [PATCH] pmdomain: mediatek: Use devm_platform_get_and_ioremap_resource() in init_scp() Markus Elfring
2024-02-05 16:31 ` Geert Uytterhoeven
2024-02-05 17:28 ` Markus Elfring [this message]
2024-02-05 19:01 ` Geert Uytterhoeven
2024-02-06 6:48 ` Markus Elfring
2024-02-06 9:21 ` [PATCH v2] pmdomain: mediatek: Use devm_platform_ioremap_resource() " Markus Elfring
2024-02-06 9:26 ` Geert Uytterhoeven
2024-02-06 10:10 ` AngeloGioacchino Del Regno
2024-02-06 14:55 ` Ulf Hansson
2024-02-06 9:24 ` [PATCH] pmdomain: mediatek: Use devm_platform_get_and_ioremap_resource() " AngeloGioacchino Del Regno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8f011126-c95a-4c71-8bc9-a6b0a5823c96@web.de \
--to=markus.elfring@web.de \
--cc=angelogioacchino.delregno@collabora.com \
--cc=geert@linux-m68k.org \
--cc=heiko@sntech.de \
--cc=jernej.skrabec@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox