[PATCH v2] clk: cdce9xx: Fix use of dev_read_u32_default
Quentin Schulz
quentin.schulz at cherry.de
Fri Jul 25 13:02:55 CEST 2025
Hi Andrew,
On 7/25/25 12:41 PM, Andrew Goodbody wrote:
> The function dev_read_u32_default does not return an error and the
> variable 'val' is unsigned so testing for >= 0 will always be true. It
> looks like the code was attempting to return -1 if xtal-load-pf was not
> present but that cannot work. Instead use dev_read_u32 which returns an
> error code separately from writing the value into the passed pointer.
>
> This issue was found by Smatch.
>
Fixes: 260777fc2333 ("clk: cdce9xx: add support for cdce9xx clock
synthesizer")
I believe? This should also add the original commit author in Cc which
may have more info on what was actually intended (but that was 6 years
ago already, so maybe they don't remember :) )
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
Acked-by: Quentin Schulz <quentin.schulz at cherry.de>
Thanks!
Quentin
More information about the U-Boot
mailing list