mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
clk: clk_set_default: accept no-op skip fields
The Assigned Clock parents and rates misses the fact that a "0" entry can
be passed to skip setting a parent or rate of an assigned clock as
described in the Linux clock bindings at [1].
This patch simply skips the clock reparenting if the DT parsing returns
-ENOENT and the clock rate setting if "0" is passed as clock rate.
[1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/clock/clock-bindings.txt#L135
Fixes: f4fcba5c5b
"clk: implement clk_set_defaults()"
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
314d3acd4d
commit
d64caaf77d
1 changed files with 8 additions and 0 deletions
|
@ -154,6 +154,10 @@ static int clk_set_default_parents(struct udevice *dev)
|
||||||
for (index = 0; index < num_parents; index++) {
|
for (index = 0; index < num_parents; index++) {
|
||||||
ret = clk_get_by_indexed_prop(dev, "assigned-clock-parents",
|
ret = clk_get_by_indexed_prop(dev, "assigned-clock-parents",
|
||||||
index, &parent_clk);
|
index, &parent_clk);
|
||||||
|
/* If -ENOENT, this is a no-op entry */
|
||||||
|
if (ret == -ENOENT)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("%s: could not get parent clock %d for %s\n",
|
debug("%s: could not get parent clock %d for %s\n",
|
||||||
__func__, index, dev_read_name(dev));
|
__func__, index, dev_read_name(dev));
|
||||||
|
@ -210,6 +214,10 @@ static int clk_set_default_rates(struct udevice *dev)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
for (index = 0; index < num_rates; index++) {
|
for (index = 0; index < num_rates; index++) {
|
||||||
|
/* If 0 is passed, this is a no-op */
|
||||||
|
if (!rates[index])
|
||||||
|
continue;
|
||||||
|
|
||||||
ret = clk_get_by_indexed_prop(dev, "assigned-clocks",
|
ret = clk_get_by_indexed_prop(dev, "assigned-clocks",
|
||||||
index, &clk);
|
index, &clk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue