Skip to content
Snippets Groups Projects
Commit 2c936374 authored by Beniamino Galvani's avatar Beniamino Galvani Committed by Tom Rini
Browse files

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: default avatarBeniamino Galvani <b.galvani@gmail.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 950fe26d
No related branches found
No related tags found
No related merge requests found
...@@ -312,8 +312,10 @@ static int pinctrl_generic_set_state_subnode(struct udevice *dev, ...@@ -312,8 +312,10 @@ static int pinctrl_generic_set_state_subnode(struct udevice *dev,
is_group = true; is_group = true;
strings_count = fdt_count_strings(fdt, node, strings_count = fdt_count_strings(fdt, node,
subnode_target_type); subnode_target_type);
if (strings_count < 0) if (strings_count < 0) {
return -EINVAL; /* skip this node; may contain config child nodes */
return 0;
}
} }
for (i = 0; i < strings_count; i++) { for (i = 0; i < strings_count; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment