Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1240196imw; Tue, 5 Jul 2022 06:16:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uW3bpXj3I+7D7VMrbM32xpa8vFB8jnigClDv6fk5XMej7OVIieKzCbReqv8n8lB6FIeY16 X-Received: by 2002:a17:902:e84c:b0:16a:5424:6ef4 with SMTP id t12-20020a170902e84c00b0016a54246ef4mr40742887plg.43.1657027005141; Tue, 05 Jul 2022 06:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027005; cv=none; d=google.com; s=arc-20160816; b=Fr+36fctn/nGbU2U0qWqs6JHpzDW6rJKwdU99lb6V55aKW+ZoTnAzLGAmdoonu5lQC RHsnC7Ejp8cvPXHnSL5RBzt7tH1X1GBJ0FI59IhaTlKBDaXqdOgN1zuRLlLreX5nCkga izxLh01HwsBr7C0Iu0nYouDEt698YMYE0Pmqs/koiKc4uXbiz+BuLLtUVC3uAv8xbZZI 1vhEidKdLmKCEO/yAZPVDpcfMp1/+atvQa8ifnn5Ts0OMHWwE2uNrTPKB5O2F/AiBqiJ LYaLfxZYON+THKSwljcBzC9/1LPa7KtsK1ZIDqur3CwfKNBW/4b9ffKmp773y29BMxZa rn7w== 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=YOG+J6aFOW9LqCdNaGjE1QynmnWbdXxVSj4itS2awY8=; b=m53gy/RntypxftwnnLwFoVQoNqubKG4FGa5JvVdx1/6GC+ER5CrCuuFX3tXzDSD3F7 jXIHbMF3IJcp90rcrUQ6QrM4XiY/XzLugRXeXg0sqoH/tQjZKbP5NvbLamG/iBSPtv6G BO8CLjoj3ScJLCMMPQQGA8tDlymzOeuAPNh3Tne/WF4BHIi6TsZ5qfslBcQje2rkfgQB POIisoGw5GSHQxNASq9I18TqDGAAomBudVkdwg045/5ipFXO3PMwztrNLGSx2lep1nbd dC1v8+B356eTgeUuvAF0xT0zGEPh/DA+Ak6g8tMi8aypI3m88gYP4rY8ZbpeuddHincI ZcPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HfW4fKzg; 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 b17-20020a639311000000b0040d66bdc763si41883957pge.857.2022.07.05.06.16.29; Tue, 05 Jul 2022 06:16:45 -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=HfW4fKzg; 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 S232476AbiGEL7j (ORCPT + 99 others); Tue, 5 Jul 2022 07:59:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232322AbiGEL7d (ORCPT ); Tue, 5 Jul 2022 07:59:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0C002678; Tue, 5 Jul 2022 04:59:32 -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 9BEDCB817D2; Tue, 5 Jul 2022 11:59:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5E44C341C7; Tue, 5 Jul 2022 11:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022370; bh=lNTWFd29FeHei074LkrRifrXHa5SjoBLx0HBvMGgLLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HfW4fKzgUMsnt6mQVLCqyeKjWdemWGXOHB9RHMwxAFDDzoivVdny0+nzddxS5kUEQ 1J6kBZft9vplFbPfGRK/XIGLG5xxepBRHdvPqBI9/ZWryL6Y+AXHIAFK2fDoXHicPt YX5x1OcP1QGwSJ/Bcxhm0ixRAkj+diHp/hfWoSRE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lv Ruyi , Krzysztof Kozlowski , Jakub Kicinski Subject: [PATCH 4.9 12/29] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value Date: Tue, 5 Jul 2022 13:57:53 +0200 Message-Id: <20220705115606.110327439@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115605.742248854@linuxfoundation.org> References: <20220705115605.742248854@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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,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 From: Krzysztof Kozlowski commit 5a478a653b4cca148d5c89832f007ec0809d7e6d upstream. The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Reported-by: Lv Ruyi Fixes: caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220627124048.296253-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/nfc/nfcmrvl/i2c.c | 6 +++--- drivers/nfc/nfcmrvl/spi.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) --- a/drivers/nfc/nfcmrvl/i2c.c +++ b/drivers/nfc/nfcmrvl/i2c.c @@ -186,9 +186,9 @@ static int nfcmrvl_i2c_parse_dt(struct d pdata->irq_polarity = IRQF_TRIGGER_RISING; ret = irq_of_parse_and_map(node, 0); - if (ret < 0) { - pr_err("Unable to get irq, error: %d\n", ret); - return ret; + if (!ret) { + pr_err("Unable to get irq\n"); + return -EINVAL; } pdata->irq = ret; --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -130,9 +130,9 @@ static int nfcmrvl_spi_parse_dt(struct d } ret = irq_of_parse_and_map(node, 0); - if (ret < 0) { - pr_err("Unable to get irq, error: %d\n", ret); - return ret; + if (!ret) { + pr_err("Unable to get irq\n"); + return -EINVAL; } pdata->irq = ret;