diff mbox series

[16/33] misc: rcc: keep the rcc device name for subnode

Message ID 20201014091646.4233-17-patrick.delaunay@st.com
State Superseded
Delegated to: Patrice Chotard
Headers show
Series stm32: enable logging features | expand

Commit Message

Patrick DELAUNAY Oct. 14, 2020, 9:16 a.m. UTC
Update the name associated with the RCC drivers to avoid
duplicated name with the driver name.

With this patch the traces displayed with log macro provide a
correct device name.

The rcc device name before the patch is:

 Class     Index  Probed  Driver                Name
-----------------------------------------------------------
 root          0  [ + ]   root_driver           root_driver
 simple_bus    0  [ + ]   simple_bus            |-- soc
 (...)
 nop           0  [ + ]   stm32-rcc             |   |-- rcc@50000000
 clk           0  [ + ]   stm32mp1_clk          |   |   |-- stm32mp1_clk
 reset         0  [ + ]   stm32_rcc_reset       |   |   `-- stm32_rcc_reset

And they become:
 (...)
 nop           0  [ + ]   stm32-rcc             |   |-- rcc@50000000
 clk           0  [ + ]   stm32mp1_clk          |   |   |-- rcc@50000000
 reset         0  [ + ]   stm32_rcc_reset       |   |   `-- rcc@50000000

The traces is correct:
stm32mp1_clk rcc@stm32mp1_clk: .....
=>
stm32mp1_clk rcc@50000000: .....

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

---

 drivers/misc/stm32_rcc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Patrice CHOTARD Oct. 21, 2020, 12:28 p.m. UTC | #1
Hi Patrick

On 10/14/20 11:16 AM, Patrick Delaunay wrote:
> Update the name associated with the RCC drivers to avoid
> duplicated name with the driver name.
>
> With this patch the traces displayed with log macro provide a
> correct device name.
>
> The rcc device name before the patch is:
>
>  Class     Index  Probed  Driver                Name
> -----------------------------------------------------------
>  root          0  [ + ]   root_driver           root_driver
>  simple_bus    0  [ + ]   simple_bus            |-- soc
>  (...)
>  nop           0  [ + ]   stm32-rcc             |   |-- rcc@50000000
>  clk           0  [ + ]   stm32mp1_clk          |   |   |-- stm32mp1_clk
>  reset         0  [ + ]   stm32_rcc_reset       |   |   `-- stm32_rcc_reset
>
> And they become:
>  (...)
>  nop           0  [ + ]   stm32-rcc             |   |-- rcc@50000000
>  clk           0  [ + ]   stm32mp1_clk          |   |   |-- rcc@50000000
>  reset         0  [ + ]   stm32_rcc_reset       |   |   `-- rcc@50000000
>
> The traces is correct:
> stm32mp1_clk rcc@stm32mp1_clk: .....
> =>
> stm32mp1_clk rcc@50000000: .....
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
>
> ---
>
>  drivers/misc/stm32_rcc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/stm32_rcc.c b/drivers/misc/stm32_rcc.c
> index c1a99d78e2..e46685f0e1 100644
> --- a/drivers/misc/stm32_rcc.c
> +++ b/drivers/misc/stm32_rcc.c
> @@ -54,7 +54,7 @@ static int stm32_rcc_bind(struct udevice *dev)
>  		return -ENOENT;
>  	}
>  
> -	ret = device_bind_with_driver_data(dev, drv, rcc_clk->drv_name,
> +	ret = device_bind_with_driver_data(dev, drv, dev->name,
>  					   rcc_clk->soc,
>  					   dev_ofnode(dev), &child);
>  
> @@ -67,7 +67,7 @@ static int stm32_rcc_bind(struct udevice *dev)
>  		return -ENOENT;
>  	}
>  
> -	return device_bind_with_driver_data(dev, drv, "stm32_rcc_reset",
> +	return device_bind_with_driver_data(dev, drv, dev->name,
>  					    rcc_clk->soc,
>  					    dev_ofnode(dev), &child);
>  }

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

Thanks
diff mbox series

Patch

diff --git a/drivers/misc/stm32_rcc.c b/drivers/misc/stm32_rcc.c
index c1a99d78e2..e46685f0e1 100644
--- a/drivers/misc/stm32_rcc.c
+++ b/drivers/misc/stm32_rcc.c
@@ -54,7 +54,7 @@  static int stm32_rcc_bind(struct udevice *dev)
 		return -ENOENT;
 	}
 
-	ret = device_bind_with_driver_data(dev, drv, rcc_clk->drv_name,
+	ret = device_bind_with_driver_data(dev, drv, dev->name,
 					   rcc_clk->soc,
 					   dev_ofnode(dev), &child);
 
@@ -67,7 +67,7 @@  static int stm32_rcc_bind(struct udevice *dev)
 		return -ENOENT;
 	}
 
-	return device_bind_with_driver_data(dev, drv, "stm32_rcc_reset",
+	return device_bind_with_driver_data(dev, drv, dev->name,
 					    rcc_clk->soc,
 					    dev_ofnode(dev), &child);
 }