memory: da8xx-ddrctl: simplify platform_get_resource()

Use devm_platform_get_and_ioremap_resource() instead of
platform_get_resource() and devm_ioremap_resource().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220419142859.380566-1-krzysztof.kozlowski@linaro.org
This commit is contained in:
Krzysztof Kozlowski 2022-04-19 16:28:53 +02:00
parent d37b07897e
commit 933713f5f4

View File

@ -115,8 +115,7 @@ static int da8xx_ddrctl_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ddrctl = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
ddrctl = devm_ioremap_resource(dev, res);
if (IS_ERR(ddrctl)) { if (IS_ERR(ddrctl)) {
dev_err(dev, "unable to map memory controller registers\n"); dev_err(dev, "unable to map memory controller registers\n");
return PTR_ERR(ddrctl); return PTR_ERR(ddrctl);