summaryrefslogtreecommitdiff
path: root/drivers/core/device.c
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2019-10-22 14:00:06 +0200
committerLukasz Majewski <lukma@denx.de>2019-10-22 16:14:05 +0200
commitfd1ba2965244e7628ac3aa539e51653490e1b4fe (patch)
treefef3571441f22b016b6601e73b447a82f18811b0 /drivers/core/device.c
parentdd2e0ce2a408c527b1146a9159b68565596cef56 (diff)
drivers: clk: Fix using assigned-clocks in the node of the clock it sets up
This fixes the case where assigned-clocks is used to define a clock defaults inside this same clock's node. This is used sometimes to setup a default parents and/or rate for a clock. example: muxed_clock: muxed_clock { clocks = <&clk_provider 0>, <&clk_provider 1>; #clock-cells = <0>; assigned-clocks = <&muxed_clock>; assigned-clock-parents = <&clk_provider 1>; }; It doesn't work in u-boot because the assigned-clocks are setup *before* the clock is probed. (clk_set_parent() will likely crash or fail if called before the device probe function) Making it work by handling "assigned-clocks" in 2 steps: first before the clk device is probed, and then after the clk device is probed. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r--drivers/core/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 95f26efdd3..8eabaf8b55 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -423,7 +423,7 @@ int device_probe(struct udevice *dev)
* Process 'assigned-{clocks/clock-parents/clock-rates}'
* properties
*/
- ret = clk_set_defaults(dev);
+ ret = clk_set_defaults(dev, 0);
if (ret)
goto fail;
}