From patchwork Wed May 27 03:02:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 11571693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC5D260D for ; Wed, 27 May 2020 02:58:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A182207D3 for ; Wed, 27 May 2020 02:58:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="RKVE0q1G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A182207D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9F06B1787; Wed, 27 May 2020 04:57:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F06B1787 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1590548319; bh=Eo1Vhox/TaiTUeUv5D0A/lsDgNHNUlSajajzW6ATUI8=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=RKVE0q1GBTGg8wEVEWAJASiU/BRnjXJDzOrli49lX7c3si8035K3qXAXda5DCKmuf LVR5u1CsSP8vIfkx5+szsrWz6/q8QiAmr9EHHwD03zI+VEHKHMXcuU9RTvr+Q732G6 yTioO3C4x2oBRKUzq7rJEa5N3aHxA9IRvDFCE4hk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 287C0F80149; Wed, 27 May 2020 04:57:52 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 14601F8014E; Wed, 27 May 2020 04:57:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D5C60F800FF for ; Wed, 27 May 2020 04:57:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D5C60F800FF Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6ABE37498ABE6535058E; Wed, 27 May 2020 10:57:32 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Wed, 27 May 2020 10:57:25 +0800 From: Wei Yongjun To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , "Liam Girdwood" , Mark Brown , "Jaroslav Kysela" , Takashi Iwai Subject: [PATCH -next] ASoC: mmp-sspa: Fix return value check in asoc_mmp_sspa_probe() Date: Wed, 27 May 2020 03:02:10 +0000 Message-ID: <20200527030210.124393-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Cc: kernel-janitors@vger.kernel.org, alsa-devel@alsa-project.org, Wei Yongjun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- sound/soc/pxa/mmp-sspa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c index 3e37ab625f8d..4255851c71c1 100644 --- a/sound/soc/pxa/mmp-sspa.c +++ b/sound/soc/pxa/mmp-sspa.c @@ -493,13 +493,13 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev) return -ENODEV; sspa->rx_base = devm_ioremap(&pdev->dev, res->start, 0x30); - if (IS_ERR(sspa->rx_base)) - return PTR_ERR(sspa->rx_base); + if (!sspa->rx_base) + return -ENOMEM; sspa->tx_base = devm_ioremap(&pdev->dev, res->start + 0x80, 0x30); - if (IS_ERR(sspa->tx_base)) - return PTR_ERR(sspa->tx_base); + if (!sspa->tx_base) + return -ENOMEM; sspa->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(sspa->clk))