linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: starfive: jh7110: ignore disabled device tree nodes
@ 2023-12-01  9:23 Nam Cao
  2023-12-01  9:23 ` [PATCH 2/2] pinctrl: starfive: jh7100: " Nam Cao
  2023-12-04 10:11 ` [PATCH 1/2] pinctrl: starfive: jh7110: " Linus Walleij
  0 siblings, 2 replies; 8+ messages in thread
From: Nam Cao @ 2023-12-01  9:23 UTC (permalink / raw)
  To: Emil Renner Berthing, Jianlong Huang, Hal Feng, Linus Walleij,
	Huan Feng, Andy Shevchenko, Drew Fustini, linux-gpio,
	linux-kernel
  Cc: Nam Cao, stable

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: 447976ab62c5 ("pinctrl: starfive: Add StarFive JH7110 sys controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
 drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
index 640f827a9b2c..b4f799572689 100644
--- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
+++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
@@ -135,7 +135,7 @@ static int jh7110_dt_node_to_map(struct pinctrl_dev *pctldev,
 	int ret;
 
 	ngroups = 0;
-	for_each_child_of_node(np, child)
+	for_each_available_child_of_node(np, child)
 		ngroups += 1;
 	nmaps = 2 * ngroups;
 
@@ -150,7 +150,7 @@ static int jh7110_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 = of_property_count_u32_elems(child, "pinmux");
 		int *pins;
 		u32 *pinmux;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-12-04 10:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01  9:23 [PATCH 1/2] pinctrl: starfive: jh7110: ignore disabled device tree nodes Nam Cao
2023-12-01  9:23 ` [PATCH 2/2] pinctrl: starfive: jh7100: " Nam Cao
2023-12-01 14:28   ` Emil Renner Berthing
2023-12-01 14:43     ` Emil Renner Berthing
2023-12-04  8:08       ` Nam Cao
2023-12-04  8:05     ` Nam Cao
2023-12-04 10:14   ` Linus Walleij
2023-12-04 10:11 ` [PATCH 1/2] pinctrl: starfive: jh7110: " Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).