From nobody Fri Dec 19 19:23:28 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63A56ECAAA1 for ; Mon, 24 Oct 2022 16:48:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbiJXQsa (ORCPT ); Mon, 24 Oct 2022 12:48:30 -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-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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-acc= det.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); =20 priv->accdet_irq =3D platform_get_irq(pdev, 0); - if (priv->accdet_irq) { + if (priv->accdet_irq >=3D 0) { ret =3D 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) =20 if (priv->caps & ACCDET_PMIC_EINT0) { priv->accdet_eint0 =3D platform_get_irq(pdev, 1); - if (priv->accdet_eint0) { + if (priv->accdet_eint0 >=3D 0) { ret =3D 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 =3D platform_get_irq(pdev, 2); - if (priv->accdet_eint1) { + if (priv->accdet_eint1 >=3D 0) { ret =3D devm_request_threaded_irq(&pdev->dev, priv->accdet_eint1, NULL, mt6359_accdet_irq, --=20 2.35.1