Skip to contentSkip to conversation

power: reset: at91-sama5d2_shdwc: Use devm_platform_get_and_ioremap_resource()

PATCH In review [email protected] 2 participants 2 messages Feb 15, 2023 – Feb 16, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: reset: at91-sama5d2_shdwc: 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.

---
 drivers/power/reset/at91-sama5d2_shdwc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/power/reset/at91-sama5d2_shdwc.c +1 -3
index d8ecffe72f16..3142ac53782b 100644
@@ -331,7 +331,6 @@ static const struct of_device_id at91_pmc_ids[] = {
 
 static int __init at91_shdwc_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	const struct of_device_id *match;
 	struct device_node *np;
 	u32 ddr_type;
@@ -349,8 +348,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, at91_shdwc);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	at91_shdwc->shdwc_base = devm_ioremap_resource(&pdev->dev, res);
+	at91_shdwc->shdwc_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
 	if (IS_ERR(at91_shdwc->shdwc_base))
 		return PTR_ERR(at91_shdwc->shdwc_base);
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On 15.02.2023 08:50, [email protected] wrote:

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

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.

Quoted 28 lines
---
 drivers/power/reset/at91-sama5d2_shdwc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/power/reset/at91-sama5d2_shdwc.c +1 -4
index d8ecffe72f16..3142ac53782b 100644
@@ -331,7 +331,6 @@ static const struct of_device_id at91_pmc_ids[] = {
 
 static int __init at91_shdwc_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        const struct of_device_id *match;
        struct device_node *np;
        u32 ddr_type;
@@ -349,8 +348,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, at91_shdwc);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       at91_shdwc->shdwc_base = devm_ioremap_resource(&pdev->dev, res);
+       at91_shdwc->shdwc_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
        if (IS_ERR(at91_shdwc->shdwc_base))
                return PTR_ERR(at91_shdwc->shdwc_base);
 
--

2.25.1