mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-21 20:34:38 +00:00
timer-uclass: Always use "clock-frequency" property as fallback
Currently the "clock-frequency" DT property is only being considered as an fallback if either there is no clock driver, the clock driver implements the request-op correctly or there is no clock defined for the timer at all. This patch makes "clock-frequency" also being picked as a fallback if getting the clock-rate fails, since clk_get(_by_index) will return no error, if a clock driver does not implement the request-op and does also not support getting the rate of the clock in question. timer_post_probe will take care if the property does not exist in the DT or is defined as 0. Signed-off-by: Alex Bee <knaerzche@gmail.com>
This commit is contained in:
parent
891b178c57
commit
d6d8078cb3
1 changed files with 6 additions and 6 deletions
|
@ -66,15 +66,15 @@ static int timer_pre_probe(struct udevice *dev)
|
||||||
err = clk_get_by_index(dev, 0, &timer_clk);
|
err = clk_get_by_index(dev, 0, &timer_clk);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
ret = clk_get_rate(&timer_clk);
|
ret = clk_get_rate(&timer_clk);
|
||||||
if (IS_ERR_VALUE(ret))
|
if (!IS_ERR_VALUE(ret)) {
|
||||||
return ret;
|
|
||||||
uc_priv->clock_rate = ret;
|
uc_priv->clock_rate = ret;
|
||||||
} else {
|
return 0;
|
||||||
uc_priv->clock_rate =
|
|
||||||
dev_read_u32_default(dev, "clock-frequency", 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uc_priv->clock_rate = dev_read_u32_default(dev, "clock-frequency", 0);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue