From patchwork Wed May 6 14:30:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tang Bin X-Patchwork-Id: 11531313 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 93C5792A for ; Wed, 6 May 2020 14:36:34 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 718442076D for ; Wed, 6 May 2020 14:36:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L/xS4aDA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 718442076D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=K7SZnAmjN+OBfA0t/FXxplPT7p3ovlElHmxPmq0tlLs=; b=L/xS4aDAAX7y/e 4NV4JE6JptPyVtQVzu8kgiWavWsXgZM06KX9apaj54dA84qu2xfmmY4ZnYrQ2+By1b4vMEIbx7q/T Byrs3QPLs87qh3WLXmiUO4NtlVPI2IFY3778zooVyAJ3X149Yc8WrrKqwAWQQCNQyirmh6YSto9Cx VEhLFefU9CEhf4yX2CIeMIenBUJB/lh0wZ+7Jw3rvkpQIfNb0OBWqDNk5cMAWsy/D2H4mEInJYB6H 2HGvM6lwKiI9VWwoLJg/fnPnx/2CwFzpXFjFvbM79xP17QGdfo1986/6up7W3Xvy7BOzNgMlB8aIG 67kK3Zk5eIfUcHISHfHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWLA0-0006oj-9U; Wed, 06 May 2020 14:36:32 +0000 Received: from cmccmta1.chinamobile.com ([221.176.66.79]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWL9w-0006nq-I5 for linux-arm-kernel@lists.infradead.org; Wed, 06 May 2020 14:36:30 +0000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee15eb2c9d0770-27990; Wed, 06 May 2020 22:29:36 +0800 (CST) X-RM-TRANSID: 2ee15eb2c9d0770-27990 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[112.0.146.193]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65eb2c9cc322-73c3f; Wed, 06 May 2020 22:29:36 +0800 (CST) X-RM-TRANSID: 2ee65eb2c9cc322-73c3f From: Tang Bin To: broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, matthias.bgg@gmail.com Subject: [PATCH] ASoC: mediatek: Fix error handling Date: Wed, 6 May 2020 22:30:09 +0800 Message-Id: <20200506143009.13368-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200506_073629_399760_26004284 X-CRM114-Status: UNSURE ( 8.45 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [221.176.66.79 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Tang Bin , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Zhang Shengju , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If the function platform_get_irq() failed, the negative value returned will not be detected here. So fix error handling in mt6797_afe_pcm_dev_probe(). And when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin --- sound/soc/mediatek/mt6797/mt6797-afe-pcm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c b/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c index 378bfc16e..a621dcf91 100644 --- a/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c +++ b/sound/soc/mediatek/mt6797/mt6797-afe-pcm.c @@ -807,10 +807,9 @@ static int mt6797_afe_pcm_dev_probe(struct platform_device *pdev) /* request irq */ irq_id = platform_get_irq(pdev, 0); - if (!irq_id) { - dev_err(dev, "%pOFn no irq found\n", dev->of_node); - return -ENXIO; - } + if (irq_id < 0) + return irq_id; + ret = devm_request_irq(dev, irq_id, mt6797_afe_irq_handler, IRQF_TRIGGER_NONE, "asys-isr", (void *)afe); if (ret) {