Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1580380rwn; Fri, 9 Sep 2022 00:07:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR69TWDEGvKDMyNRaep0LwielRQLoUwJMTw37r7jY/bd2DAKqhOriQ/0Ta4SJHlJFZEylnDb X-Received: by 2002:a2e:be05:0:b0:25f:d8fb:afbc with SMTP id z5-20020a2ebe05000000b0025fd8fbafbcmr3722012ljq.369.1662707269175; Fri, 09 Sep 2022 00:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662707269; cv=none; d=google.com; s=arc-20160816; b=XFDx3e5KX/XPkBHti7J5AUV7GcQb5++EUqmFmyQTIdBFl9UD4/+QV7jQ2TRVHMnCRc 1XS+glI4/mFo+UgR+H8UwcUC3x4PrrSnpvsxEgpm9kK/VL+Eed5IqoIb7VwRgwWYVFZ1 i1cThRRtIErtuWkah1iJzivvSib+LKMSkL0EzUkABJ/WraA6hueRQyRgHu0rvsyRKh3I YZIjsmq67ey4+0nyv68D3W6MtircsO8FEFi4SMh1AjoYgKXJmMhnecFCZTL7FMxc8G2c lRqMg84LXU2Q+bdzx33+DJ9iXjIC36aBL0xXWCfG7/KzgN48WLPzA9T7TAtVn3OkDMP6 OM5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=JmGZk+jQFAEiH3JwSTcQKy/FhWJAfUDEUzJ2Ol2leIo=; b=PVK7x/dWalOlkiu8y/w8E5SzHj0Nnv3hT+PkddGHRJBBoLQ5qmoY3zx6KH1XOm01jH t0MzM3MFbdx8g6yjjuRf0Aw5FCP//l172/OwlqYBd5HJhhtlRsCS2QsQs9Osi/CGjX2r /7mHMPKM8IKDfI08xBy8HZIVOUTdQbsQsl/e36Bbo6WeINRl9MGpMcgwBqBdhMejYhIM VSmDZpyUEyQNJRgv3lEI/EGbiZjiTiH0UBeea6HpHU5tYA70ArDHJx0kQIU9x7AVC+6b rnPH7DG6Ai+YwormyBspCjq+e6ZHlOTf8OdUX0kepSHXKJ61fyaf3hq06q0ijIF4ZrHn AQwA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a2e7d08000000b0025e4ee1f697si439974ljc.311.2022.09.09.00.07.07; Fri, 09 Sep 2022 00:07:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230350AbiIIGqP (ORCPT + 99 others); Fri, 9 Sep 2022 02:46:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbiIIGqL (ORCPT ); Fri, 9 Sep 2022 02:46:11 -0400 Received: from mail.nfschina.com (mail.nfschina.com [124.16.136.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BFE9B113C7F for ; Thu, 8 Sep 2022 23:46:08 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 73E231E80D5E; Fri, 9 Sep 2022 14:44:37 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KCJdTlgd51AI; Fri, 9 Sep 2022 14:44:34 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: yuzhe@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 4EE7A1E80D06; Fri, 9 Sep 2022 14:44:34 +0800 (CST) From: Yu Zhe To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com Cc: alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, liqiong@nfschina.com, Yu Zhe Subject: [PATCH] ASoC: mediatek: mt6359: fix platform_get_irq error checking Date: Fri, 9 Sep 2022 14:45:11 +0800 Message-Id: <20220909064511.22343-1-yuzhe@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 The platform_get_irq() function returns negative error codes on error, fix the checking. Signed-off-by: Yu Zhe --- 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..b70aac5075ad 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.11.0