From patchwork Fri Dec 1 09:23:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nam Cao X-Patchwork-Id: 749595 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tGDR9eZq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="A9ARbpvm" Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B37A2194; Fri, 1 Dec 2023 01:23:36 -0800 (PST) From: Nam Cao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nAuB+NWb1+h9nrirqejk/RLzcirj6WRcoSRAbARMZUA=; b=tGDR9eZqdwVBv7/g90Ct9HkZutigEwF7ngGXBC+BJCXQQoFHN4SZeJEcPAk1kEfZK6uhUm jev2BdKZEWpF96N55lxD2jYDQO8NnCDrFcmrDHV9VSQg2CvYF1KJoXjQS3Ih7oTZTIgTQb p+1WMxrsmgMvM6U3hx8fQKu01nBI5+XqdYV1RBPRjOQ6OHIULZ9D9NIGTKEcGo4pidOeT6 Rcq7KgFbkeumyAQzK+S8hG2IvvAI3FV21O9L9iJSbHl1tyzcnjjYNy9qJF9yxC3sQzbjGP IoepgDGclqu+dwbYuaRJr0BcAsz35D9078zP+x+vnZeL/Nr4u710h/8ErzjxSQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nAuB+NWb1+h9nrirqejk/RLzcirj6WRcoSRAbARMZUA=; b=A9ARbpvm7QOTKyyBB7JLD1eW7y/nyFyioCc01jf3h7pElP7NZmdrLwXNwXLV59pcm5uQGw X5zAVFsE//77j/Cw== To: Emil Renner Berthing , Jianlong Huang , Hal Feng , Linus Walleij , Huan Feng , Andy Shevchenko , Drew Fustini , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nam Cao , stable@vger.kernel.org Subject: [PATCH 2/2] pinctrl: starfive: jh7100: ignore disabled device tree nodes Date: Fri, 1 Dec 2023 10:23:29 +0100 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The driver always registers pin configurations in device tree. This can cause some inconvenience to users, as pin configurations in the base device tree cannot be disabled in the device tree overlay, even when the relevant devices are not used. Ignore disabled pin configuration nodes in device tree. Fixes: ec648f6b7686 ("pinctrl: starfive: Add pinctrl driver for StarFive SoCs") Cc: stable@vger.kernel.org Signed-off-by: Nam Cao --- drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c index 530fe340a9a1..561fd0c6b9b0 100644 --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c @@ -492,7 +492,7 @@ static int starfive_dt_node_to_map(struct pinctrl_dev *pctldev, nmaps = 0; ngroups = 0; - for_each_child_of_node(np, child) { + for_each_available_child_of_node(np, child) { int npinmux = of_property_count_u32_elems(child, "pinmux"); int npins = of_property_count_u32_elems(child, "pins"); @@ -527,7 +527,7 @@ static int starfive_dt_node_to_map(struct pinctrl_dev *pctldev, nmaps = 0; ngroups = 0; mutex_lock(&sfp->mutex); - for_each_child_of_node(np, child) { + for_each_available_child_of_node(np, child) { int npins; int i;