Commit 6dfdf6e4 authored by YueHaibing's avatar YueHaibing Committed by Bjorn Andersson

remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories()

In case of error, the function devm_ioremap_wc() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Reviewed-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Fixes: 6edbe024 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Acked-by: default avatarSuman Anna <s-anna@ti.com>
Link: https://lore.kernel.org/r/20200905122503.17352-1-yuehaibing@huawei.comSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent c0a6e5ee
......@@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev,
kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start,
resource_size(res));
if (IS_ERR(kproc->mem[i].cpu_addr)) {
if (!kproc->mem[i].cpu_addr) {
dev_err(dev, "failed to map %s memory\n",
data->mems[i].name);
return PTR_ERR(kproc->mem[i].cpu_addr);
return -ENOMEM;
}
kproc->mem[i].bus_addr = res->start;
kproc->mem[i].dev_addr = data->mems[i].dev_addr;
......
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