From: YueHaibing <[email protected]>

[ Upstream commit 6dfdf6e4e7096fead7755d47d91d72e896bb4804 ]

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: Mathieu Poirier <[email protected]>
Fixes: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x 
DSPs")
Signed-off-by: YueHaibing <[email protected]>
Acked-by: Suman Anna <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bjorn Andersson <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
 drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c 
b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
index 9011e477290ce..863c0214e0a8e 100644
--- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
@@ -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;
-- 
2.27.0



Reply via email to