remoteproc: st_slim: Use devm_platform_ioremap_resource_byname()

platform_get_resource_byname() and devm_ioremap_resource() can be
replaced by devm_platform_ioremap_resource_byname(), which can
simplify the code logic a bit, No functional change here.

Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Link: https://lore.kernel.org/r/20240906113405.92782-2-zhangzekun11@huawei.com
[Fixed patch title]
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
Zhang Zekun 2024-09-06 19:34:03 +08:00 committed by Mathieu Poirier
parent 77fcdf51b8
commit b472e756ad

View File

@ -259,16 +259,14 @@ struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev,
slim_rproc->mem[i].size = resource_size(res); slim_rproc->mem[i].size = resource_size(res);
} }
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "slimcore"); slim_rproc->slimcore = devm_platform_ioremap_resource_byname(pdev, "slimcore");
slim_rproc->slimcore = devm_ioremap_resource(dev, res);
if (IS_ERR(slim_rproc->slimcore)) { if (IS_ERR(slim_rproc->slimcore)) {
dev_err(&pdev->dev, "failed to ioremap slimcore IO\n"); dev_err(&pdev->dev, "failed to ioremap slimcore IO\n");
err = PTR_ERR(slim_rproc->slimcore); err = PTR_ERR(slim_rproc->slimcore);
goto err; goto err;
} }
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "peripherals"); slim_rproc->peri = devm_platform_ioremap_resource_byname(pdev, "peripherals");
slim_rproc->peri = devm_ioremap_resource(dev, res);
if (IS_ERR(slim_rproc->peri)) { if (IS_ERR(slim_rproc->peri)) {
dev_err(&pdev->dev, "failed to ioremap peripherals IO\n"); dev_err(&pdev->dev, "failed to ioremap peripherals IO\n");
err = PTR_ERR(slim_rproc->peri); err = PTR_ERR(slim_rproc->peri);