Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1255373imw; Tue, 5 Jul 2022 06:30:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tk+/UwRZKEjD+ZDEgPfWUUKKRma8iMKUFwzbkdM6fIiDgyVZY87AGkPCOV11bXCRWNbPRJ X-Received: by 2002:a05:6402:b34:b0:435:d064:8762 with SMTP id bo20-20020a0564020b3400b00435d0648762mr46828012edb.238.1657027858414; Tue, 05 Jul 2022 06:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027858; cv=none; d=google.com; s=arc-20160816; b=uIYZ8i79kfd6Cyy6RdsU12g9d0qDkih1xcs+Xcpqf4DSY6fSqKMdjqdNBY+Lv3Kp+P zEgHPal3NpO+C5ghSOpbov87oSF1mmN+r6dP1jXaOlQ0f3aRhOAfHty22bY76J0Bdfs6 cjSvB5mVfRCfItGYqXJrrkjOXBOTG4GD9Z32EXG5qRTq0GFQp2f6FDrsBk2L+ew5evTV 2rJlhTHVVKVEJ/ycghxFvRmx6LSABcWz7m2qBiwJ39zHFXwHpAYxzd21bkp+nifIjt/7 t8cnJNwBUNyJdW2YKeIndv1hoM6ThEpIqQ2v4hVAENeSXfJkGhcPMEHMKiDST3w7Pgs4 dYFw== 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=mdGGebNOKEuPSBQaMECTnTEyB8VyjiGQUoCGehYgR4U=; b=Sv3QXKlOBhHUv4bC3BvUWyfBCGDYm54teHUmQmLiFLEOERUZUvN9pxb0e9Lr8MZNq6 ijEJ9dmHhFJ3vzsF1E4oZfWEjHUDPaIIvCj3xB2JDpY7yljnhcA/RoE3XuKbywu02HOg xxr/XQL1xyE66jAA2X4/wVgLT/ddo44jvsHmYKmth19OYrdxU1hByFeOT6ZOdEEtU+g8 euka+LMGJ6VrihdgjU74t+YrOltskfvnPome17tG3ZzCC7buLKvoVa0Ou5vcWzbEV8vt Zt9wRb5M+eDe3a7pJ305wdDxwo9cbusvEHxXLxlr0lRa2zW2qVOa5UqjNMD8O876WKke Vy2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hQNkk1oB; 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 h22-20020a056402281600b0043577827670si20192945ede.354.2022.07.05.06.30.33; Tue, 05 Jul 2022 06:30:58 -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=hQNkk1oB; 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 S233771AbiGEMEZ (ORCPT + 99 others); Tue, 5 Jul 2022 08:04:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbiGEMCh (ORCPT ); Tue, 5 Jul 2022 08:02:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0987918344; Tue, 5 Jul 2022 05:02:37 -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 B4980B817CC; Tue, 5 Jul 2022 12:02:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24FE4C341C7; Tue, 5 Jul 2022 12:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022554; bh=eWhg2Htyke+OsaZs7/m9A1zorj1Ngbbnj7Lp253PPtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQNkk1oBCdsYHP6OGsp7P4JxYlXL322dGVNf32Pix1ONFTFKQAqxztT3VEQhGnEwL E4QIX5CCDMEVG2/rGAiCIaVEPa/8zyXLyAgPXBW1YpIK2I1VP0phAalxLLIczHCs4K tnSWgVOIH9xOrkdCOV5HvUrXoB734zubE3PkWQ8U= 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.19 19/33] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value Date: Tue, 5 Jul 2022 13:58:11 +0200 Message-Id: <20220705115607.275417561@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115606.709817198@linuxfoundation.org> References: <20220705115606.709817198@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 @@ -129,9 +129,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;