From patchwork Sun Jan 29 08:42:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 13120048 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F6B8C61D97 for ; Sun, 29 Jan 2023 08:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XoKcgvJ+dBEREbSDvamhz0uqed2ZOdctDqkI6BZx5LE=; b=RAVF0oOoS8GPDY LQqkfl2DivZ/rYL1YvooUSKDCk3PAlJ8VoK7nKkqSEjUA9cGHx5fMjAaHKhxMYTd7ptdY3c14sjvx zmeCK9dzvxR3KXI5Um4+z1WSH9KP4K8WioHF33IsJzi86+MOW7mNb42fI6VVuQuXsOG0Mark1mkYm 8lg6Rsxt+i+JI3I+BueVj0xi+oLSkPrEKBHr730Wp1CxVv44uhMTKLDOGA878Sd3Ja9C3JTpatVRW A4eld7OUoi4p7RYC4l1RwX7rlEAkTDyninV6bKEs5SM+g7yAlkygS1/DEz1aoObLJnM1g9CvMG4l/ Kte3ALpX4UUCSIIf+yiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pM3HX-001Ds4-IY; Sun, 29 Jan 2023 08:43:23 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pM3HT-001DrS-Ba for linux-arm-kernel@lists.infradead.org; Sun, 29 Jan 2023 08:43:21 +0000 Received: from dggpemm100007.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4P4Pvx1F0hzfZ18; Sun, 29 Jan 2023 16:42:53 +0800 (CST) Received: from huawei.com (10.175.103.91) by dggpemm100007.china.huawei.com (7.185.36.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sun, 29 Jan 2023 16:42:59 +0800 From: Yang Yingliang To: , CC: , , , , , , , Subject: [PATCH -next] coresight: tpda: fix return value check in tpda_probe() Date: Sun, 29 Jan 2023 16:42:46 +0800 Message-ID: <20230129084246.537694-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100007.china.huawei.com (7.185.36.116) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230129_004319_669358_D452706E X-CRM114-Status: GOOD ( 10.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org devm_ioremap_resource() never returns NULL pointer, it will return ERR_PTR() when it fails, so replace the check with IS_ERR(). Fixes: 5b7916625c01 ("Coresight: Add TPDA link driver") Signed-off-by: Yang Yingliang --- drivers/hwtracing/coresight/coresight-tpda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c index 19c25c9f6157..6313b12880e0 100644 --- a/drivers/hwtracing/coresight/coresight-tpda.c +++ b/drivers/hwtracing/coresight/coresight-tpda.c @@ -145,7 +145,7 @@ static int tpda_probe(struct amba_device *adev, const struct amba_id *id) dev_set_drvdata(dev, drvdata); base = devm_ioremap_resource(dev, &adev->res); - if (!base) + if (IS_ERR(base)) return -ENOMEM; drvdata->base = base;