Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1253434imw; Tue, 5 Jul 2022 06:29:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uc+LJJLKkcCI7ZnSxbHQfw5CTkH/0EOpTFKPkCegWYBchwOIx4/rCWzyqj/jJx3xCqbpJu X-Received: by 2002:a62:b60d:0:b0:528:99aa:da09 with SMTP id j13-20020a62b60d000000b0052899aada09mr2116177pff.86.1657027754003; Tue, 05 Jul 2022 06:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027753; cv=none; d=google.com; s=arc-20160816; b=HWasiYfRWx+0vdKQESRvtBA4x0NgrSFXTiLKHyur0V3XOmM99XjDiiVKbrzB6Rr109 B7GN0r6fV9GrksRlZtWOEUXzFjRVgRWyBskqZ7EvL+kSYFs5JAA+0hWoMRqPAV67wQ1t VqCh4w226LcEi0v4kMo9aXh4h5MewVKBRLJCt+1X1W7iaONtznT54abMxhxzNnYKxZTD r40HEmrIpTBtf8irE/4bahjKNb6G5neZXqUm929s1k5NoOHjts9Uv3uzIeIxy87ZHaEC hLs+xEzoKPW2yjmfqgyiHvM7MJXYMrl2sjJjUS0cdRO97PPEyzHXRCY3NIEiwJpFbCdo I1ug== 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=XNl3sehmfsoCk2Bhwe6b7ajBRM1L6nrpZRs5lEaeZH8t43Lw80nP8CqQytRA+ye8M7 ywcipuWezUerjY5JnSgacN7qixARrJeUwySdQvLtm9j9lHyCgiYE0+NI5IEYhxc88Myy SM6piGTW7KjgiNBDxZvMwl9wh+uwLD8d5ha2Mbv12vwqS3/i0hNTplr17dymLQ8jpkNK SFXuJUFMjyWPbdb6Wt88SThfaVZPrsbxxRGvALde0tZI6X8hcSPpiAvTz4iZyeiBR76H W7sja9fXdvDY94X0zgb+j3VJUgMOLDroAX8fcLbfWc1HP9Qt7NV6xWQkuJvp71xtdr0L uyow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RlGhsr6R; 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 p7-20020a17090a868700b001ef86e417ecsi7698755pjn.182.2022.07.05.06.29.02; Tue, 05 Jul 2022 06:29:13 -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=RlGhsr6R; 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 S235395AbiGEMMH (ORCPT + 99 others); Tue, 5 Jul 2022 08:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234417AbiGEMHb (ORCPT ); Tue, 5 Jul 2022 08:07:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D30DB18E37; Tue, 5 Jul 2022 05:06:23 -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 7E797B817D6; Tue, 5 Jul 2022 12:06:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6285C341CD; Tue, 5 Jul 2022 12:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657022781; bh=eWhg2Htyke+OsaZs7/m9A1zorj1Ngbbnj7Lp253PPtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RlGhsr6RVpI6o5eCVRxMAmOEGzBcWx6o3hc16PzOIX5LBW3JjD9l6Zl3fAJnKvL+i PRTZbLECxmGbU7jxFd3FY+thGImSFvSoObinjJSCy9WjIXrcD3EPgVZCuDyleCBFnc JzbOWW1CDZZT6UM0uRYEDb1cayfnN1/GW2etnEW4= 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 5.4 26/58] nfc: nfcmrvl: Fix irq_of_parse_and_map() return value Date: Tue, 5 Jul 2022 13:58:02 +0200 Message-Id: <20220705115611.018632184@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115610.236040773@linuxfoundation.org> References: <20220705115610.236040773@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;