Commit 5383953f authored by Yangtao Li's avatar Yangtao Li Committed by Krzysztof Kozlowski

memory: samsung: exynos5422-dmc: Convert to devm_platform_ioremap_resource

Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Acked-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 81a0efb7
...@@ -1374,7 +1374,6 @@ static int exynos5_dmc_probe(struct platform_device *pdev) ...@@ -1374,7 +1374,6 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct exynos5_dmc *dmc; struct exynos5_dmc *dmc;
struct resource *res;
int irq[2]; int irq[2];
dmc = devm_kzalloc(dev, sizeof(*dmc), GFP_KERNEL); dmc = devm_kzalloc(dev, sizeof(*dmc), GFP_KERNEL);
...@@ -1386,13 +1385,11 @@ static int exynos5_dmc_probe(struct platform_device *pdev) ...@@ -1386,13 +1385,11 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
dmc->dev = dev; dmc->dev = dev;
platform_set_drvdata(pdev, dmc); platform_set_drvdata(pdev, dmc);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dmc->base_drexi0 = devm_platform_ioremap_resource(pdev, 0);
dmc->base_drexi0 = devm_ioremap_resource(dev, res);
if (IS_ERR(dmc->base_drexi0)) if (IS_ERR(dmc->base_drexi0))
return PTR_ERR(dmc->base_drexi0); return PTR_ERR(dmc->base_drexi0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); dmc->base_drexi1 = devm_platform_ioremap_resource(pdev, 1);
dmc->base_drexi1 = devm_ioremap_resource(dev, res);
if (IS_ERR(dmc->base_drexi1)) if (IS_ERR(dmc->base_drexi1))
return PTR_ERR(dmc->base_drexi1); return PTR_ERR(dmc->base_drexi1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment