On 2/9/26 9:14 PM, Jonas Karlman wrote:
clk_get_rate() in U-Boot is documented to return clock rate on success,
0 for invalid clock and -ve error code for other errors. This differ
slightly from Linux where only >= 0 is returned from clk_get_rate().

Some clock drivers take advantage of this difference and may return -ve
error code for clocks not fully supported in U-Boot.

Use IS_ERR_VALUE() to check for an error code in addition to current
invalid clock check to fix broken and unpredicted behavior when clock
driver returns a -ve error code for the ref_clk.

Signed-off-by: Jonas Karlman <[email protected]>
I wonder if it would be better to fix the API discrepancy . Could you try that instead ?

Reply via email to