Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2003178pxk; Sat, 5 Sep 2020 05:26:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuIro12Kacz15sKpkhRW3t0TxuMuZfvQs//cJasNGBhWhtYAXcC3bOru5e2ncIAIYtw26H X-Received: by 2002:a17:906:cc8d:: with SMTP id oq13mr12000579ejb.280.1599308804800; Sat, 05 Sep 2020 05:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599308804; cv=none; d=google.com; s=arc-20160816; b=hNQkR/yvQQ4K3faXxjPPYrhUJ3Y7BHDYUl2x/BsSTi9po/6vHZF/cUSIA2WwY8AFwW AqiTqs3U6WQSRPlMNEK0JPyVQZmZyWFtZvRbBIvWfuJzJTFdTUpEmwykN5qW96Z+05Mf 2g04YIfwdBc8NNsyMPeUYjkSwE4NoaRU58XT5qp0tes2ethaypzi5h1LfvBLXK4cjSCc ruAuiGhD1KOp8rXKe5baoZUIxChMbTw7sFFcUM1r9BY9RK42Z7HuWMAcIMCaebzYxR1A qRe57CQPWKp1Y6OqsDtlliOVlFaSC/BnZ0duBpPUYjXJhBao1r9vSnegkUPKpowLd5xt o2PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=bAYyUejFEW79sPBhJUVZTJJ0xPkZGz8g0TsjrGPQeIg=; b=W1j0pxxPhZlLQjUqg268bm98K8Q/pnHFsiKlMUEXBDpL62rRJHdOFWrJKFXFfhu64z e5/KVBx/GXj6GKvFVQXPIe62PWA48dzCarJUbictWGe6w0Z9X/msINYwqaWb545ffml0 fX6Dd/CSycaPJS6VivMEKRaQJkMYq1cGRpA898UhVjvxLAG+YUfTi8XuLDtUtcP/kKkg FbzAFnyNoKIrWnJd3aSsh0kmJdvUggHFn6G4z7AouIhOcNrjWlZ45wpWhQWhEHAic/QN Yt8wm2Kk6nXxHuU8tz6Zzr5ndvQqXyBztVHIanfsb0tbIE/Yb/4NxM8ENlbJdNW4aZ4S q4IA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si6204035eju.401.2020.09.05.05.26.20; Sat, 05 Sep 2020 05:26:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728524AbgIEMZg (ORCPT + 99 others); Sat, 5 Sep 2020 08:25:36 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:38094 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726597AbgIEMZe (ORCPT ); Sat, 5 Sep 2020 08:25:34 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 57EFFB9297F9C12ED5B5; Sat, 5 Sep 2020 20:25:31 +0800 (CST) Received: from localhost (10.174.179.108) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Sat, 5 Sep 2020 20:25:23 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH v2 -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() Date: Sat, 5 Sep 2020 20:25:03 +0800 Message-ID: <20200905122503.17352-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20200902140614.28636-1-yuehaibing@huawei.com> References: <20200902140614.28636-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.108] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: 6edbe024ba17 ("remoteproc: k3-dsp: Add a remoteproc driver of K3 C66x DSPs") Signed-off-by: YueHaibing Acked-by: Suman Anna --- v2: return ENOMEM instead of EBUSY, use corret Fixes tag --- 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 9011e477290c..f373df35d7d0 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.17.1