mirror of
https://xff.cz/git/u-boot/
synced 2025-09-30 23:11:32 +02:00
tegra: clock: Avoid a divide-by-zero error
The clock fix-up for tegra is still present in the code. It causes a
divide-by-zero bug after relocation when chain-loading U-Boot from
coreboot. Fix this by adding a check.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 7468676
(ARM: tegra: fix clock_get_periph_rate() for UART clocks)
This commit is contained in:
@@ -339,7 +339,10 @@ unsigned long clock_get_periph_rate(enum periph_id periph_id,
|
|||||||
* return value doesn't help. In summary this clock driver is
|
* return value doesn't help. In summary this clock driver is
|
||||||
* quite broken but I'm afraid I have no idea how to fix it
|
* quite broken but I'm afraid I have no idea how to fix it
|
||||||
* without completely replacing it.
|
* without completely replacing it.
|
||||||
|
*
|
||||||
|
* Be careful to avoid a divide by zero error.
|
||||||
*/
|
*/
|
||||||
|
if (div >= 1)
|
||||||
div -= 2;
|
div -= 2;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user