2023-02-15 06:52:16

by ye.xingchen

[permalink] [raw]
Subject: [PATCH] power: reset: brcm-kona-reset: Use devm_platform_get_and_ioremap_resource()

From: Ye Xingchen <[email protected]>

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: Ye Xingchen <[email protected]>
---
drivers/power/reset/brcm-kona-reset.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/reset/brcm-kona-reset.c b/drivers/power/reset/brcm-kona-reset.c
index 3de024e3ceb7..02a056983291 100644
--- a/drivers/power/reset/brcm-kona-reset.c
+++ b/drivers/power/reset/brcm-kona-reset.c
@@ -38,9 +38,7 @@ static struct notifier_block kona_reset_nb = {

static int kona_reset_probe(struct platform_device *pdev)
{
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
- kona_reset_base = devm_ioremap_resource(&pdev->dev, res);
+ kona_reset_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
if (IS_ERR(kona_reset_base))
return PTR_ERR(kona_reset_base);

--
2.25.1


2023-02-24 21:24:38

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] power: reset: brcm-kona-reset: Us e devm_platform_get_and_ioremap_resource()

On 2/14/23 22:52, [email protected] wrote:
> From: Ye Xingchen <[email protected]>
>
> 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: Ye Xingchen <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian