Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4795032iob; Mon, 9 May 2022 01:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaKP3khiaTEQp8kLmaq0VZ11t4FBlurLCWs+yk0A7fBkh2xVSVDbRyaarsMonbD6hNnBfB X-Received: by 2002:a17:902:ea11:b0:15e:ae19:f36a with SMTP id s17-20020a170902ea1100b0015eae19f36amr15249155plg.52.1652085568097; Mon, 09 May 2022 01:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652085568; cv=none; d=google.com; s=arc-20160816; b=p2ufuS6BsaQVnIL0EMv5zLhe34e1kL1nJdsYxKD+KrHRV1YMnwsqOpSaOtYoQohlKN NOY1q0+aWLiTPahlLzluECGIIxzElCHtrR0IO+W+PuotlLSU+HemQFJEkOqYCJLLfxXO rjuHWciNF5rZaGICWQnMzPBX+gV3KYL72wZQJtbLS6xigHXp5KAg2zXM3gQPkahOrxtT NoLvHKojrsqT2XQwunldoQtIvEdMT65+4wU5lypRyNAKo5B383wyrJTPIF8oEnZFl9Of 0m3as7teWHDND98arDnorZygu9PwHvUpEiI/aBhPT3mkgZdCUgTBDiT8yvMJX/m1Tqol 7WlQ== 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=cyxYNe2rEdILQPW27fVW7F3j1ETdOJiIGayNnmBOErc=; b=0WZn6LZdZ9Gbj7zmVkpgLVlzofPs6sGpPxdzIZ6LonAyCnhfFPnOQ6zQg39vR8exre eAZ8IEL6OE4ii6J2325lmzWvVcwCWn167CnzNsRKI1QjggsWLA248iuLr6bGmXRzKFpa FkptUJwjBVBcWpGpUtMkgXfhbiS8bFvxbA3ALQd3OQPfT1FFQcHIg2RAAebPcltjOGz6 LmK9ySCMMe5g0iMKVP7HgcdJ2K3Sxajmz8Igf8x3KQu+sKRUDRKvHulssoh8SBdtbkfO 7lsx9YszdkKUTcx+oJ+O2t9jokL0TXBaurXKCdAzSUBklVpNk1km1majffELlSiIb6Mg Us3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HcTvBeay; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w22-20020a1709029a9600b00156ea908d59si10454823plp.304.2022.05.09.01.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:39:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HcTvBeay; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F50D1D811F; Mon, 9 May 2022 01:22:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357070AbiEDRTU (ORCPT + 99 others); Wed, 4 May 2022 13:19:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356327AbiEDRFI (ORCPT ); Wed, 4 May 2022 13:05:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1644149F18; Wed, 4 May 2022 09:54:01 -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 C2C51B82795; Wed, 4 May 2022 16:53:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66DB1C385A5; Wed, 4 May 2022 16:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683238; bh=+UBJ4i3Fl2GsTUI0Gp8N2JfuB7Nvbo2PZZ9YAnUaWY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HcTvBeayIZIxoArx+PrgVV/M1beS5Q0v/blShaA/0f9QeFu3bow1Xvw8akQiMi2ZM BcvLTAeinTFHNyYKkPLyihBSyzzyxSfQ25jWcFoMlDSO4pbhakycdVr9uZeD6HxQuZ J538HJM9+mE0s60W4yOoDiytOJFRJLQZxZqJsyq0= 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.15 091/177] pinctrl: pistachio: fix use of irq_of_parse_and_map() Date: Wed, 4 May 2022 18:44:44 +0200 Message-Id: <20220504153101.240475507@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 8d271c6b0ca4..5de691c630b4 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