Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7109653rwi; Mon, 24 Oct 2022 09:57:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM715HZVmay/SZAK2f8MAx6HeLSatZcFo+UcZHHOWW4BBzrc3ieR4Qn94BtCvIsGP3Oj1d1j X-Received: by 2002:a17:90b:1c88:b0:203:8400:13a9 with SMTP id oo8-20020a17090b1c8800b00203840013a9mr40370832pjb.46.1666630620396; Mon, 24 Oct 2022 09:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666630620; cv=none; d=google.com; s=arc-20160816; b=el4dcQ7AN0PAtJfx7AO9KB7DHtyrZLOVvn2vC+BhSO3DvnvU2xITMOkAPNwlMAH62f qE84stsBIT0yKR6fXFSaa5IVHFSEOqppConriBJQICGPfrZVasV+ooI4EHKbKbFvmaDB bnECtDZGcc4o8Q1B4nXIY1MKv5D7h6VE+8ZzMVPrNg9lT9VBZxkbBMGNcV1SXTJiiyx7 FEyFn9GX7mb8qDCIGHuL1epyovgpWa73UND04Hri9F3XoRH8qTIsjJyleVAV/sy+oY8/ 0T6sJGUSMINCMwJCvEl4j5xiZRRLWe+v2WNWW8mecRjkXAib0iK9PsfPIQgUuYTOYG0Y qC5Q== 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=KL5COwY2hM//1SD/nKKwiPnqV7sQOMu9EL/dYe+Dxl6lpnjW3SA44ja1HbVOFTkK13 XDmfQHbAWlyevYE7cJQGQTKo+hFN5uFrp5LiddlroRDNs+JTfPS4zww7aklY1b2N8vaC c8k/5RQ5JqtxkIW0wW9It8SgzKp8QDCU7RZJiRR7iu5n8paYgYqC2EaFYnw2k/vApaEx nID885Np54lNBcR+JC5Z/16lHtZ/cncsCv6hKcbYDe5+GixAWvUlj9QPJVDZocFG+5qw QX+OVxLM6E+hcteeWyH+5QGsf/Sm0nP02KndWecmhbITDP6MAMO2Ip/WjeBFh5c5uA71 bfWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="pTBd1/OS"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a631f14000000b0046ae8195c0asi36452567pgf.611.2022.10.24.09.56.44; Mon, 24 Oct 2022 09:57:00 -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="pTBd1/OS"; 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 S232265AbiJXQsZ (ORCPT + 99 others); Mon, 24 Oct 2022 12:48:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235035AbiJXQqu (ORCPT ); Mon, 24 Oct 2022 12:46:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17CD71989B5; Mon, 24 Oct 2022 08:31:11 -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 67FB4B8199C; Mon, 24 Oct 2022 12:42:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF1DFC433C1; Mon, 24 Oct 2022 12:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615348; bh=juEF15GNwvV1UwXjbjTX7qGN5uH7jvIijRl/WPZIT4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pTBd1/OSwSmnruLV4dY4ZdIUuiP9PiaSpFgD1LjCEmw1yGSRPeWZQYu90uPnbP94l DKJbqJgkRIj1CavAC57c6c4i3+9+x1MsXXYxI5pLYM3/pOrJRYKYyjCb62LtI09djO zu8sYUQjOBfuhWxt/G/CwJ6UdwyMMtf2SKpzBeFQ= 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.15 216/530] ASoC: mt6359: fix tests for platform_get_irq() failure Date: Mon, 24 Oct 2022 13:29:20 +0200 Message-Id: <20221024113054.866327372@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 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 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, -- 2.35.1