[PATCH] clk: fixed_rate: Avoid calling dev_read_*() if CONFIG_OF_PLATDATA=y

Marek Vasut marek.vasut at mailbox.org
Fri Nov 21 18:53:43 CET 2025


On 11/21/25 6:35 PM, Simon Glass wrote:

Hello Simon,

>> To be made to clk_fixed_rate_ofdata_to_plat_(...) in
>> drivers/clk/clk_fixed_rate.c as it does not currently call
>> dev_has_ofnode(dev).
> 
> Ah OK. So the call stack is something like:
> 
> dev_read_u32_default()
> dev_ofnode() - returns ofnode_null
> ofnode_read_u32_default()
> ofnode_read_u32_index
> fdt_getprop(NULL, -1, ...)   // guess
> 
> And I see that I put assert() in some of the ofnode_read..() functions
> because I don't have tests for passing an invalid ofnode.
> 
> So perhaps fdt_offset_ptr_() should check for NULL and return? I
> haven't traced it though.

In previous patch

[PATCH 3/3] libfdt: Check fdt_offset_ptr() return value unconditionally

that approach seems to have been rejected, and these dev_read_*() fixes 
were implemented as a replacement.


More information about the U-Boot mailing list