All of lore.kernel.org
 help / color / mirror / Atom feed
From: Beniamino Galvani <b.galvani@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes
Date: Tue, 16 Aug 2016 11:49:47 +0200	[thread overview]
Message-ID: <1471340990-16247-2-git-send-email-b.galvani@gmail.com> (raw)
In-Reply-To: <1471340990-16247-1-git-send-email-b.galvani@gmail.com>

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>
---
 drivers/pinctrl/pinctrl-generic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-generic.c b/drivers/pinctrl/pinctrl-generic.c
index e86b72a..baff40f 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++) {
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: b.galvani@gmail.com (Beniamino Galvani)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 1/4] pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes
Date: Tue, 16 Aug 2016 11:49:47 +0200	[thread overview]
Message-ID: <1471340990-16247-2-git-send-email-b.galvani@gmail.com> (raw)
In-Reply-To: <1471340990-16247-1-git-send-email-b.galvani@gmail.com>

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>
---
 drivers/pinctrl/pinctrl-generic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-generic.c b/drivers/pinctrl/pinctrl-generic.c
index e86b72a..baff40f 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++) {
-- 
2.7.4

  reply	other threads:[~2016-08-16  9:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16  9:49 [U-Boot] [PATCH 0/4] Amlogic Meson pinctrl driver for u-boot Beniamino Galvani
2016-08-16  9:49 ` Beniamino Galvani
2016-08-16  9:49 ` Beniamino Galvani [this message]
2016-08-16  9:49   ` [PATCH 1/4] pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes Beniamino Galvani
2016-08-18  3:44   ` [U-Boot] " Simon Glass
2016-08-18  3:44     ` Simon Glass
2016-08-19  9:19   ` [U-Boot] " Masahiro Yamada
2016-08-19  9:19     ` Masahiro Yamada
2016-09-07 17:57   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-07 17:57     ` Tom Rini
2016-08-16  9:49 ` [U-Boot] [PATCH 2/4] arm: dts: update DTS files for meson-gxbb and odroid-c2 Beniamino Galvani
2016-08-16  9:49   ` Beniamino Galvani
2016-08-18  3:44   ` [U-Boot] " Simon Glass
2016-08-18  3:44     ` Simon Glass
2016-09-07 17:57   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-07 17:57     ` [U-Boot,2/4] " Tom Rini
2016-08-16  9:49 ` [U-Boot] [PATCH 3/4] pinctrl: add driver for meson-gxbb pin controller Beniamino Galvani
2016-08-16  9:49   ` Beniamino Galvani
2016-08-18  3:44   ` [U-Boot] " Simon Glass
2016-08-18  3:44     ` Simon Glass
2016-09-07 17:57   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-07 17:57     ` [U-Boot,3/4] " Tom Rini
2016-09-07 17:57   ` [U-Boot] [U-Boot, 3/4] " Tom Rini
2016-09-07 17:57     ` [U-Boot,3/4] " Tom Rini
2016-08-16  9:49 ` [U-Boot] [PATCH 4/4] meson: odroid-c2: enable Ethernet support through the device tree Beniamino Galvani
2016-08-16  9:49   ` Beniamino Galvani
2016-08-18  3:44   ` [U-Boot] " Simon Glass
2016-08-18  3:44     ` Simon Glass
2016-09-07 17:57   ` [U-Boot] [U-Boot, " Tom Rini
2016-09-07 17:57     ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471340990-16247-2-git-send-email-b.galvani@gmail.com \
    --to=b.galvani@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.