From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrice CHOTARD Date: Fri, 22 Jan 2021 09:33:45 +0100 Subject: [PATCH 2/2] pinctrl: stm32: bind only the enabled GPIO subnode In-Reply-To: <20210121173856.2.I0a3428974f4b9205c6a22076bf60c87639520b20@changeid> References: <20210121163908.17678-1-patrick.delaunay@foss.st.com> <20210121173856.2.I0a3428974f4b9205c6a22076bf60c87639520b20@changeid> Message-ID: <2ed6d99d-90cc-6e08-1966-b415839301d8@foss.st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > > 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 Thanks Patrice