From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] pinctrl: stm32: bind only the enabled GPIO subnode
Date: Fri, 22 Jan 2021 09:33:45 +0100 [thread overview]
Message-ID: <2ed6d99d-90cc-6e08-1966-b415839301d8@foss.st.com> (raw)
In-Reply-To: <20210121173856.2.I0a3428974f4b9205c6a22076bf60c87639520b20@changeid>
Hi Patrick
On 1/21/21 5:39 PM, Patrick Delaunay wrote:
> Bind only the enabled GPIO subnode, to avoid to probe the node
> "gpio-controller" present in SOC dtsi (disabled by default) but
> not enabled in the included pincontrol dtsi file.
>
> For example, in stm32mp15xxac-pinctrl.dtsi 2 gpio bank are absent:
> gpioj: gpio at 5000b000
> gpiok: gpio at 5000c000
>
> Then these GPIO are absent in output of command "dm tree" and
> "gpio status -a"
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
>
> drivers/pinctrl/pinctrl_stm32.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pinctrl/pinctrl_stm32.c b/drivers/pinctrl/pinctrl_stm32.c
> index 374f76d881..6c98538f56 100644
> --- a/drivers/pinctrl/pinctrl_stm32.c
> +++ b/drivers/pinctrl/pinctrl_stm32.c
> @@ -409,6 +409,9 @@ static int stm32_pinctrl_bind(struct udevice *dev)
> dev_for_each_subnode(node, dev) {
> dev_dbg(dev, "bind %s\n", ofnode_get_name(node));
>
> + if (!ofnode_is_enabled(node))
> + continue;
> +
> ofnode_get_property(node, "gpio-controller", &ret);
> if (ret < 0)
> continue;
>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
next prev parent reply other threads:[~2021-01-22 8:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 16:39 [PATCH 0/2] pinctrl: stm32: correction for pinmux status Patrick Delaunay
2021-01-21 16:39 ` [PATCH 1/2] pinctrl: stm32: correct management pin display of OTYPE Patrick Delaunay
2021-01-22 8:33 ` Patrice CHOTARD
2021-02-09 9:33 ` Patrick DELAUNAY
2021-01-21 16:39 ` [PATCH 2/2] pinctrl: stm32: bind only the enabled GPIO subnode Patrick Delaunay
2021-01-22 8:33 ` Patrice CHOTARD [this message]
2021-02-09 9:33 ` Patrick DELAUNAY
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=2ed6d99d-90cc-6e08-1966-b415839301d8@foss.st.com \
--to=patrice.chotard@foss.st.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.