Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2727233iob; Fri, 6 May 2022 09:07:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL+nQka+GZjqemHExo6BS9TBaRLyW84DACcEJeo1+YHKWwMwtYFIesWdaIngWtXHRfkLWq X-Received: by 2002:a17:907:3f8e:b0:6f4:4723:4185 with SMTP id hr14-20020a1709073f8e00b006f447234185mr3538422ejc.359.1651853270597; Fri, 06 May 2022 09:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651853270; cv=none; d=google.com; s=arc-20160816; b=pZXpY4VoetIThr/G0GKQKZrsfPwQhOPM5hIs4KhcJXhV8cRLxh+IPr6mXbon88BKJF uQt6g+b5OYYKka7GDHtI8jKUdzN8ws/QzT7KH80hAkOV6vtyrCYKDRk1vSUeLuWd893j IAK5xN8iVen+4m6oLLE2U9D0NGcRsuQ/FVWY7VnsUINCFLWWvFFx1yToIJuSCB1hxGga zhM4YCvChuVGU+i8ibDAwvSOZjx3IQeqfevQoa+6meiBihV+AgsIz3YhZgidz+dDoVK5 sHCKKdIaEbwKZG7rXV5rETwtsmf6SMhq3xZWDkGzV4k/Ih7Bsdxai2uEn/gVZaXXzAgr 96aw== 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=43xNwKCOK/AdXp1L0UeTLftbx9OjlMhoDAL17TRu59Y=; b=a+t07Q2AEOaFyVffbEhZDRNZE9Yu8d0QGU1dka8wMSjiJWkk2LogtN5XpmqTmoQg5T y0MNrIHrNjABRh3abYMwZ8yAjRUf12cPAVEEnczkRFxiFFHA+LVLm4IoAxZ9aWVSsbQv ggnw7ZBgnc4er7FJbHGfrDBrLOS8VONTl7f42yeiPDRE+cG2iOPxP29UuQxLRFPYDiog VVfE6G+yUUa2KHfeDsIdrVDXLdLPS1Jp+kPHcBJI8BtsE9ocEQ9P4euPDrJMq4XybHlv tZacFeNEeviCiIpZIneqgPGZJtI/DZ/mECq15v1GaGkAB7uKoBj3UI+Nrvu44ZHCD9LQ iujw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hp+4w2Bn; 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 q25-20020a170906361900b006e7f5d0f45asi4800081ejb.791.2022.05.06.09.07.25; Fri, 06 May 2022 09:07:50 -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=hp+4w2Bn; 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 S1354986AbiEDRGx (ORCPT + 99 others); Wed, 4 May 2022 13:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355244AbiEDQ7t (ORCPT ); Wed, 4 May 2022 12:59:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 157E049686; Wed, 4 May 2022 09:51:24 -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 dfw.source.kernel.org (Postfix) with ESMTPS id EC300617C2; Wed, 4 May 2022 16:51:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 457B7C385AF; Wed, 4 May 2022 16:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683083; bh=JSCa2iDFyLjNaathPK9LBYB8qEdrw+UHxwx06chyEuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hp+4w2BnX4CDB9qWJH1EQr2oXNJXq7T9zSUa2OOnUYFMvLlKQN5+TAUBqXhMtbDvu i/cUg/an+MABgzS1vJbdJTZpv9YmkaqmV04iCrXBwqp2IllCohGF3p6FHm8OtCn3cx BC21GPiyo90R/GfcBrTbGBC4pBk8lIYzoR00pJLQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zeal Robot , Lv Ruyi , Linus Walleij , Sasha Levin Subject: [PATCH 5.10 074/129] pinctrl: pistachio: fix use of irq_of_parse_and_map() Date: Wed, 4 May 2022 18:44:26 +0200 Message-Id: <20220504153027.095704950@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@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.7 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: Lv Ruyi [ Upstream commit 0c9843a74a85224a89daa81fa66891dae2f930e1 ] The irq_of_parse_and_map() function returns 0 on failure, and does not return an negative value. Fixes: cefc03e5995e ("pinctrl: Add Pistachio SoC pin control driver") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220424031430.3170759-1-lv.ruyi@zte.com.cn Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-pistachio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index ec761ba2a2da..989a37fb402d 100644 --- a/drivers/pinctrl/pinctrl-pistachio.c +++ b/drivers/pinctrl/pinctrl-pistachio.c @@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) } irq = irq_of_parse_and_map(child, 0); - if (irq < 0) { - dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq); + if (!irq) { + dev_err(pctl->dev, "No IRQ for bank %u\n", i); of_node_put(child); - ret = irq; + ret = -EINVAL; goto err; } -- 2.35.1