diff mbox series

[7/9] memory: samsung: exynos5422-dmc: convert to devm_platform_ioremap_resource

Message ID 20191222185034.4665-7-tiny.windzz@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/9] memory: emif: convert to devm_platform_ioremap_resource | expand

Commit Message

Yangtao Li Dec. 22, 2019, 6:50 p.m. UTC
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/memory/samsung/exynos5422-dmc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Lukasz Luba Dec. 30, 2019, 9:13 a.m. UTC | #1
Hi,

On 12/22/19 6:50 PM, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>   drivers/memory/samsung/exynos5422-dmc.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
> index 47dbf6d1789f..81a1b1d01683 100644
> --- a/drivers/memory/samsung/exynos5422-dmc.c
> +++ b/drivers/memory/samsung/exynos5422-dmc.c
> @@ -1374,7 +1374,6 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
>   	struct device *dev = &pdev->dev;
>   	struct device_node *np = dev->of_node;
>   	struct exynos5_dmc *dmc;
> -	struct resource *res;
>   	int irq[2];
>   
>   	dmc = devm_kzalloc(dev, sizeof(*dmc), GFP_KERNEL);
> @@ -1386,13 +1385,11 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
>   	dmc->dev = dev;
>   	platform_set_drvdata(pdev, dmc);
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	dmc->base_drexi0 = devm_ioremap_resource(dev, res);
> +	dmc->base_drexi0 = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(dmc->base_drexi0))
>   		return PTR_ERR(dmc->base_drexi0);
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	dmc->base_drexi1 = devm_ioremap_resource(dev, res);
> +	dmc->base_drexi1 = devm_platform_ioremap_resource(pdev, 1);
>   	if (IS_ERR(dmc->base_drexi1))
>   		return PTR_ERR(dmc->base_drexi1);
>   
> 

Acked-by: Lukasz Luba <lukasz.luba@arm.com>

Regards,
Lukasz
Krzysztof Kozlowski Dec. 30, 2019, 5:56 p.m. UTC | #2
On Sun, Dec 22, 2019 at 06:50:32PM +0000, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/memory/samsung/exynos5422-dmc.c | 7 ++-----

Thanks, applied.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 47dbf6d1789f..81a1b1d01683 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -1374,7 +1374,6 @@  static int exynos5_dmc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct exynos5_dmc *dmc;
-	struct resource *res;
 	int irq[2];
 
 	dmc = devm_kzalloc(dev, sizeof(*dmc), GFP_KERNEL);
@@ -1386,13 +1385,11 @@  static int exynos5_dmc_probe(struct platform_device *pdev)
 	dmc->dev = dev;
 	platform_set_drvdata(pdev, dmc);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dmc->base_drexi0 = devm_ioremap_resource(dev, res);
+	dmc->base_drexi0 = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dmc->base_drexi0))
 		return PTR_ERR(dmc->base_drexi0);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	dmc->base_drexi1 = devm_ioremap_resource(dev, res);
+	dmc->base_drexi1 = devm_platform_ioremap_resource(pdev, 1);
 	if (IS_ERR(dmc->base_drexi1))
 		return PTR_ERR(dmc->base_drexi1);