remoteproc/mediatek: use devm_platform_ioremap_resource_byname

Replaces platform_get_resource_byname() and devm_ioremap_resource()
pairs to devm_platform_ioremap_resource_byname().

Note that, not every pairs are applicable to replace.  Especially when
it needs to access the resource struct from
platform_get_resource_byname().
For example:
scp->sram_size = resource_size(res);

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210127083136.3745652-2-tzungbi@google.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Tzung-Bi Shih 2021-01-27 16:31:33 +08:00 committed by Bjorn Andersson
parent ec8207ae39
commit 2e88e8fcdf

View file

@ -721,8 +721,7 @@ static int scp_probe(struct platform_device *pdev)
for (i = 0; i < SCP_IPI_MAX; i++)
mutex_init(&scp->ipi_desc[i].lock);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg");
scp->reg_base = devm_ioremap_resource(dev, res);
scp->reg_base = devm_platform_ioremap_resource_byname(pdev, "cfg");
if (IS_ERR((__force void *)scp->reg_base)) {
dev_err(dev, "Failed to parse and map cfg memory\n");
ret = PTR_ERR((__force void *)scp->reg_base);