]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
misc: rcc: keep the rcc device name for subnode
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 6 Nov 2020 18:01:44 +0000 (19:01 +0100)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 13 Jan 2021 08:52:58 +0000 (09:52 +0100)
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>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
drivers/misc/stm32_rcc.c

index 4625e91396fd0c6b3e3b80c070f2a2280fbf992a..f14d6e26d9c88ffd1b8e7ef9aec63f330616cb20 100644 (file)
@@ -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);
 }