diff options
author | Beniamino Galvani <b.galvani@gmail.com> | 2016-08-16 11:49:47 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-09-06 13:18:19 -0400 |
commit | 2c936374c81a24a461cf71725a1e9ce439e048ed (patch) | |
tree | 1962a556ccf23abac5b994036bf7a7a685643726 /drivers/pinctrl | |
parent | 950fe26de9d6e7355b96c6f5dcc8455398216b9f (diff) |
pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes
In cases where the pins and groups definitions are in a sub-node, as:
uart_a {
mux {
groups = "uart_tx_a", "uart_rx_a";
function = "uart_a";
};
};
pinctrl_generic_set_state_subnode() returns an error for the top-level
node and pinctrl_generic_set_state() fails. Instead, return success so
that the child nodes are tried.
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-generic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-generic.c b/drivers/pinctrl/pinctrl-generic.c index e86b72a8dee..baff40f1f0d 100644 --- a/drivers/pinctrl/pinctrl-generic.c +++ b/drivers/pinctrl/pinctrl-generic.c @@ -312,8 +312,10 @@ static int pinctrl_generic_set_state_subnode(struct udevice *dev, is_group = true; strings_count = fdt_count_strings(fdt, node, subnode_target_type); - if (strings_count < 0) - return -EINVAL; + if (strings_count < 0) { + /* skip this node; may contain config child nodes */ + return 0; + } } for (i = 0; i < strings_count; i++) { |