Skip to contentSkip to conversation

devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource()

PATCH In review Yang Li 3 participants 4 messages Mar 28, 2023

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 devfreq: exynos-ppmu: Use devm_platform_get_and_ioremap_resource()

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.

---
 drivers/devfreq/event/exynos-ppmu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/devfreq/event/exynos-ppmu.c +1 -2
index a443e7c42daf..896a6cc93b00 100644
@@ -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);
 
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw
Quoted 2 lines · Yang Li

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.

Quoted 3 lines

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

Reviewed-by
#2 lore raw

Hi,

Quoted 10 lines · Krzysztof Kozlowski
Quoted 2 lines · Yang Li

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.

Quoted 3 lines

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

Thanks,
Andi

#3 lore raw
Quoted 17 lines · Andi Shyti

Hi,

Quoted 10 lines · Krzysztof Kozlowski
Quoted 2 lines · Yang Li

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.

Quoted 3 lines

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:

Quoted 6 lines

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

Quoted 3 lines

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

Best regards,
Krzysztof