diff mbox series

[1/2] pinctrl: stmfx: update pincontrol and gpio device name

Message ID 20201028095157.11327-1-patrick.delaunay@st.com
State Accepted
Delegated to: Patrick Delaunay
Headers show
Series [1/2] pinctrl: stmfx: update pincontrol and gpio device name | expand

Commit Message

Patrick Delaunay Oct. 28, 2020, 9:51 a.m. UTC
The device name is used in pinmux command and in log trace
so it is better to use the parent parent name ("stmfx@42" for
example) than a generic name ("pinctrl" or "stmfx-gpio")
to identify the device instance.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 drivers/pinctrl/pinctrl-stmfx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Patrice CHOTARD Nov. 4, 2020, 8:35 a.m. UTC | #1
Hi Patrick

On 10/28/20 10:51 AM, Patrick Delaunay wrote:
> The device name is used in pinmux command and in log trace
> so it is better to use the parent parent name ("stmfx@42" for
> example) than a generic name ("pinctrl" or "stmfx-gpio")
> to identify the device instance.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  drivers/pinctrl/pinctrl-stmfx.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
> index c2ea82770e..b789f3686c 100644
> --- a/drivers/pinctrl/pinctrl-stmfx.c
> +++ b/drivers/pinctrl/pinctrl-stmfx.c
> @@ -408,8 +408,11 @@ static int stmfx_pinctrl_bind(struct udevice *dev)
>  {
>  	struct stmfx_pinctrl *plat = dev_get_platdata(dev);
>  
> +	/* subnode name is not explicit: use father name */
> +	device_set_name(dev, dev->parent->name);
> +
>  	return device_bind_driver_to_node(dev->parent,
> -					  "stmfx-gpio", "stmfx-gpio",
> +					  "stmfx-gpio", dev->parent->name,
>  					  dev_ofnode(dev), &plat->gpio);
>  };
>  

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

Patrice
Patrick Delaunay Nov. 25, 2020, 11 a.m. UTC | #2
Hi,

> From: Patrick DELAUNAY <patrick.delaunay@st.com>
> Sent: mercredi 28 octobre 2020 10:52
> 
> The device name is used in pinmux command and in log trace so it is better to
> use the parent parent name ("stmfx@42" for
> example) than a generic name ("pinctrl" or "stmfx-gpio") to identify the device
> instance.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
> 
>  drivers/pinctrl/pinctrl-stmfx.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 

Applied to u-boot-stm/master, thanks!

Regards

Patrick
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index c2ea82770e..b789f3686c 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -408,8 +408,11 @@  static int stmfx_pinctrl_bind(struct udevice *dev)
 {
 	struct stmfx_pinctrl *plat = dev_get_platdata(dev);
 
+	/* subnode name is not explicit: use father name */
+	device_set_name(dev, dev->parent->name);
+
 	return device_bind_driver_to_node(dev->parent,
-					  "stmfx-gpio", "stmfx-gpio",
+					  "stmfx-gpio", dev->parent->name,
 					  dev_ofnode(dev), &plat->gpio);
 };