From patchwork Sat Oct 22 07:23:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7374 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096555wrr; Sat, 22 Oct 2022 01:05:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60Re54uBVpDnDQqyjVgVQRQvH80zArubpUlcJrrtf3ZbbHP2OrJ+pzYXbB2n2IFp9AatSR X-Received: by 2002:a17:903:1105:b0:178:ae31:aad with SMTP id n5-20020a170903110500b00178ae310aadmr23047214plh.3.1666425926025; Sat, 22 Oct 2022 01:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425926; cv=none; d=google.com; s=arc-20160816; b=aG+lZQS2hSGF30c+hNYXPDd26GGSk4r9FsEsRm15/OO2NmPfqe8bCQ5Tci5Gv8b2S9 pPLR4ppAYgbiO+nMU/iss4kpLgmLkK/jxz71zc+AcJ3Ce1Adogbq4TKS2sCjwFDRECHq l71bByECqfmigxIypF6LuBc/eTLHeWrZS6tLuXl4aKwITG9FAcnoERqVa6f2nzbLy/S2 u6vRJNxPIfNY3ieycG8bJKXdR+fmi4fLQFMVYk5BhbHO7Ua1NuUNlH52klZAMyoMUPOP Uk0Bglo/O+SQNJ1yzbEOQgFqXKZAnSZMjLl6k3WhPed0t6GNF4oT6ozpv2L2gJ2mWao+ ouIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+2OlzfpS5MMajXr+hZlxFbQG1yH4zv3SD1T4YaiRlB8=; b=furDW0Lfu5+Ff8PAhDvKahgKhwMw1RAf/5MBqorBZraqvV07zTjsJCiyJGkMm82hnx xbPi+lVeaS2k21RorlICPxATMc5ib6TE3rQizl3a+D9sH5OxI7iNqG7JpEblvCVUaAxV 4OWRW0GKnTgDEQB+icH9CJA3KGg0xG3Y+xzSitFIFkaFtdXf8OHWT79KVX73Z3iyjEJp 7oMkQgghGmn/K5MA/lav6uUqXeaxCeOjef93psZDhQcrzGEmYuIm5NIXGvLSnmhiJgrw PvwOfS1lSWB2nB6Xoi4Q6Rzwix2ydvbXUgm7avz0bV8PDMikssb7B3yTRi4ih9sCpUnH aLtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ve7dQ7sI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t185-20020a6381c2000000b00437e609414dsi26798720pgd.563.2022.10.22.01.05.12; Sat, 22 Oct 2022 01:05:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ve7dQ7sI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232683AbiJVIDy (ORCPT + 99 others); Sat, 22 Oct 2022 04:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbiJVH4z (ORCPT ); Sat, 22 Oct 2022 03:56:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC5425B108; Sat, 22 Oct 2022 00:48:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 861DEB82E17; Sat, 22 Oct 2022 07:47:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B405BC433C1; Sat, 22 Oct 2022 07:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424863; bh=juEF15GNwvV1UwXjbjTX7qGN5uH7jvIijRl/WPZIT4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ve7dQ7sIUqHX948qp3RKXBk+e1F6fOSNMpEmz3zSuAQQOc6+fWezZsJif6mY+8IyY QY70ede0xTKdQcTe3RBfJMGuMERmj3j1qeLLiAPnM3k9YUI1xW4E7xit8cp25nXv4y elkfThQNbswyqu8ufDSjq0lUNqAWWv8rtVERWI2k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Mark Brown , Sasha Levin Subject: [PATCH 5.19 305/717] ASoC: mt6359: fix tests for platform_get_irq() failure Date: Sat, 22 Oct 2022 09:23:04 +0200 Message-Id: <20221022072506.706529547@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374231796475129?= X-GMAIL-MSGID: =?utf-8?q?1747374231796475129?= From: Dan Carpenter [ Upstream commit 51eea3a6fb4d39c2cc71824e6eee5949d7ae4d1c ] The platform_get_irq() returns negative error codes. It can't actually return zero, but if it did that should be treated as success. Fixes: eef07b9e0925 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YvThhr86N3qQM2EO@kili Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/mt6359-accdet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c index c190628e2905..7f624854948c 100644 --- a/sound/soc/codecs/mt6359-accdet.c +++ b/sound/soc/codecs/mt6359-accdet.c @@ -965,7 +965,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev) mutex_init(&priv->res_lock); priv->accdet_irq = platform_get_irq(pdev, 0); - if (priv->accdet_irq) { + if (priv->accdet_irq >= 0) { ret = devm_request_threaded_irq(&pdev->dev, priv->accdet_irq, NULL, mt6359_accdet_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, @@ -979,7 +979,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev) if (priv->caps & ACCDET_PMIC_EINT0) { priv->accdet_eint0 = platform_get_irq(pdev, 1); - if (priv->accdet_eint0) { + if (priv->accdet_eint0 >= 0) { ret = devm_request_threaded_irq(&pdev->dev, priv->accdet_eint0, NULL, mt6359_accdet_irq, @@ -994,7 +994,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev) } } else if (priv->caps & ACCDET_PMIC_EINT1) { priv->accdet_eint1 = platform_get_irq(pdev, 2); - if (priv->accdet_eint1) { + if (priv->accdet_eint1 >= 0) { ret = devm_request_threaded_irq(&pdev->dev, priv->accdet_eint1, NULL, mt6359_accdet_irq,