linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource()
@ 2023-03-28  5:38 Yang Li
  2023-03-28  7:19 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Li @ 2023-03-28  5:38 UTC (permalink / raw)
  To: krzysztof.kozlowski
  Cc: kyungmin.park, myungjoo.ham, cw00.choi, alim.akhtar, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel, Yang Li

According to commit 890cc39a8799 ("drivers: provide
devm_platform_get_and_ioremap_resource()"), convert
platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/devfreq/event/exynos-ppmu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index a443e7c42daf..896a6cc93b00 100644
--- a/drivers/devfreq/event/exynos-ppmu.c
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -621,8 +621,7 @@ static int exynos_ppmu_parse_dt(struct platform_device *pdev,
 	}
 
 	/* Maps the memory mapped IO to control PPMU register */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(dev, res);
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource()
  2023-03-28  5:38 [PATCH -next] devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource() Yang Li
@ 2023-03-28  7:19 ` Krzysztof Kozlowski
  2023-03-28  9:53   ` Andi Shyti
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-28  7:19 UTC (permalink / raw)
  To: Yang Li
  Cc: kyungmin.park, myungjoo.ham, cw00.choi, alim.akhtar, linux-pm,
	linux-arm-kernel, linux-samsung-soc, linux-kernel

On 28/03/2023 07:38, Yang Li wrote:
> According to commit 890cc39a8799 ("drivers: provide
> devm_platform_get_and_ioremap_resource()"), convert

I don't understand why do you reference this commit. There is no bug
introduced there, there is nothing related to this driver.

> platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource()
  2023-03-28  7:19 ` Krzysztof Kozlowski
@ 2023-03-28  9:53   ` Andi Shyti
  2023-03-28 10:06     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Shyti @ 2023-03-28  9:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Yang Li, kyungmin.park, myungjoo.ham, cw00.choi, alim.akhtar,
	linux-pm, linux-arm-kernel, linux-samsung-soc, linux-kernel

Hi,

On Tue, Mar 28, 2023 at 09:19:01AM +0200, Krzysztof Kozlowski wrote:
> On 28/03/2023 07:38, Yang Li wrote:
> > According to commit 890cc39a8799 ("drivers: provide
> > devm_platform_get_and_ioremap_resource()"), convert
> 
> I don't understand why do you reference this commit. There is no bug
> introduced there, there is nothing related to this driver.
> 
> > platform_get_resource(), devm_ioremap_resource() to a single
> > call to devm_platform_get_and_ioremap_resource(), as this is exactly
> > what this function does.

I've seen Yang has sent many of these cleanups, perhaps he can
write something like:

"
Commit 890cc39a8799 ("drivers: provide
devm_platform_get_and_ioremap_resource()") introduces the
devm_platform_get_and_ioremap_resource() function which combines
both platform_get_resource() and devm_ioremap_resource() into a
single call.

Update the code to use the new combined function instead of the
separate calls.
"

With that

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Thanks,
Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource()
  2023-03-28  9:53   ` Andi Shyti
@ 2023-03-28 10:06     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-28 10:06 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Yang Li, kyungmin.park, myungjoo.ham, cw00.choi, alim.akhtar,
	linux-pm, linux-arm-kernel, linux-samsung-soc, linux-kernel

On 28/03/2023 11:53, Andi Shyti wrote:
> Hi,
> 
> On Tue, Mar 28, 2023 at 09:19:01AM +0200, Krzysztof Kozlowski wrote:
>> On 28/03/2023 07:38, Yang Li wrote:
>>> According to commit 890cc39a8799 ("drivers: provide
>>> devm_platform_get_and_ioremap_resource()"), convert
>>
>> I don't understand why do you reference this commit. There is no bug
>> introduced there, there is nothing related to this driver.
>>
>>> platform_get_resource(), devm_ioremap_resource() to a single
>>> call to devm_platform_get_and_ioremap_resource(), as this is exactly
>>> what this function does.
> 
> I've seen Yang has sent many of these cleanups, perhaps he can
> write something like:
> 
> "
> Commit 890cc39a8799 ("drivers: provide
> devm_platform_get_and_ioremap_resource()") introduces the
> devm_platform_get_and_ioremap_resource() function which combines
> both platform_get_resource() and devm_ioremap_resource() into a
> single call.

I don't think we need to reference that commit at all. It does not
matter when the API was introduced and just makes commit msg unnecessary
long. Instead the commit msg should shortly say why this change is
needed or even worth accepting.

> 
> Update the code to use the new combined function instead of the
> separate calls.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-28 10:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28  5:38 [PATCH -next] devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource() Yang Li
2023-03-28  7:19 ` Krzysztof Kozlowski
2023-03-28  9:53   ` Andi Shyti
2023-03-28 10:06     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).