pinctrl: starfive: jh7110: ignore disabled device tree nodes
authorNam Cao <namcao@linutronix.de>
Fri, 1 Dec 2023 09:23:28 +0000 (10:23 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 4 Dec 2023 10:11:20 +0000 (11:11 +0100)
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>
Link: https://lore.kernel.org/r/fd8bf044799ae50a6291ae150ef87b4f1923cacb.1701422582.git.namcao@linutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c

index 9d71e8c1331020cd73eb4b61aec8191a9433f8c0..6de11a4057346dcea3a9f02cf2d3fb82caa99ea9 100644 (file)
@@ -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;