From patchwork Thu Jun 8 13:57:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walker Chen X-Patchwork-Id: 690927 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 490C4C7EE29 for ; Fri, 9 Jun 2023 14:53:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 35674E7A; Fri, 9 Jun 2023 16:53:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 35674E7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686322433; bh=tcwN9aHVLp01bCBIiZFwexVGo37BFdeJXQkLrmbqsJg=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=us0V9AHxynpnE6mwKlkDHMwH10NLPNfrgwQ/QDFof6hsa0yW8wgwMkvc/w0pOOTRt yrPVfCBHaNTbTlZaL4ytsdeqrgu8OoN2uuF9oUb4yDKpb01Or3L2Qz3m7Sv3IwzmEw 7ALFJfCPPSMDw+wVOrL86Bt12AW0qe/7wAIajJic= Received: by alsa1.perex.cz (Postfix, from userid 50401) id ED257F80570; Fri, 9 Jun 2023 16:48:56 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 28049F804DA; Fri, 9 Jun 2023 16:48:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 826DAF80199; Thu, 8 Jun 2023 15:58:22 +0200 (CEST) Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 54D94F800ED for ; Thu, 8 Jun 2023 15:58:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 54D94F800ED Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id C9A688062; Thu, 8 Jun 2023 21:57:52 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 8 Jun 2023 21:57:52 +0800 Received: from SD-Server.starfivetech.com (183.27.98.122) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 8 Jun 2023 21:57:52 +0800 From: Walker Chen To: Mark Brown , Claudiu Beznea , Dan Carpenter , Liam Girdwood , Takashi Iwai , "Jaroslav Kysela" , Walker Chen CC: , Subject: [PATCH v2 1/2] ASoC: starfive: Fix an error check in jh7110_tdm_clk_reset_get() Date: Thu, 8 Jun 2023 21:57:49 +0800 Message-ID: <20230608135750.11041-2-walker.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230608135750.11041-1-walker.chen@starfivetech.com> References: <20230608135750.11041-1-walker.chen@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [183.27.98.122] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-MailFrom: walker.chen@starfivetech.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: UAYR6GA2AXDGCUF6MYSWV4IGFC7AYPT7 X-Message-ID-Hash: UAYR6GA2AXDGCUF6MYSWV4IGFC7AYPT7 X-Mailman-Approved-At: Fri, 09 Jun 2023 14:48:52 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Fix the check for devm_reset_control_array_get_exclusive() return value. The devm_reset_control_array_get_exclusive() function may return NULL if it's an optional request. If optional is intended then NULL should not be treated as an error case, but as a special kind of success case. So here the IS_ERR() is used to check better. Signed-off-by: Walker Chen --- Fix the following issue: https://lore.kernel.org/all/ZH7t6Nc+NTcGpq%2F3@moroto/ --- sound/soc/starfive/jh7110_tdm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c index 973b910d2d3e..a9a3d52bdd2a 100644 --- a/sound/soc/starfive/jh7110_tdm.c +++ b/sound/soc/starfive/jh7110_tdm.c @@ -580,10 +580,9 @@ static int jh7110_tdm_clk_reset_get(struct platform_device *pdev, } tdm->resets = devm_reset_control_array_get_exclusive(&pdev->dev); - if (IS_ERR_OR_NULL(tdm->resets)) { - ret = PTR_ERR(tdm->resets); - dev_err(&pdev->dev, "Failed to get tdm resets"); - return ret; + if (IS_ERR(tdm->resets)) { + dev_err(&pdev->dev, "Failed to get tdm resets\n"); + return PTR_ERR(tdm->resets); } return 0;