All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes
Date: Wed, 17 Aug 2016 21:44:35 -0600	[thread overview]
Message-ID: <CAPnjgZ3jRtWwxdQaDFsQY-d_K6wYNgHOp9mjectcDp==e5F0Yg@mail.gmail.com> (raw)
In-Reply-To: <1471340990-16247-2-git-send-email-b.galvani@gmail.com>

On 16 August 2016 at 03:49, Beniamino Galvani <b.galvani@gmail.com> wrote:
> 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(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Masahiro, are you happy with this change?

We really need some pinctrl tests.

>
> 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
>

Regards,
Simon

WARNING: multiple messages have this Message-ID (diff)
From: sjg@chromium.org (Simon Glass)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 1/4] pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes
Date: Wed, 17 Aug 2016 21:44:35 -0600	[thread overview]
Message-ID: <CAPnjgZ3jRtWwxdQaDFsQY-d_K6wYNgHOp9mjectcDp==e5F0Yg@mail.gmail.com> (raw)
In-Reply-To: <1471340990-16247-2-git-send-email-b.galvani@gmail.com>

On 16 August 2016 at 03:49, Beniamino Galvani <b.galvani@gmail.com> wrote:
> 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(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Masahiro, are you happy with this change?

We really need some pinctrl tests.

>
> 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
>

Regards,
Simon

  reply	other threads:[~2016-08-18  3:44 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 ` [U-Boot] [PATCH 1/4] pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes Beniamino Galvani
2016-08-16  9:49   ` Beniamino Galvani
2016-08-18  3:44   ` Simon Glass [this message]
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='CAPnjgZ3jRtWwxdQaDFsQY-d_K6wYNgHOp9mjectcDp==e5F0Yg@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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.