[PATCH] clk: Dont return error when assigned-clocks is empty or missing

Sean Anderson seanga2 at gmail.com
Tue Jul 11 16:28:42 CEST 2023


On 7/11/23 10:20, Michal Simek wrote:
> Hi Sean,
> 
> On 7/11/23 15:40, Sean Anderson wrote:
>> On 7/11/23 05:51, Ashok Reddy Soma wrote:
>>> There is a chance that assigned-clock-rates is given and assigned-clocks
>>> could be empty. Dont return error in that case, because the probe of the
>>> corresponding driver will not be called at all if this fails.
>>> Better to continue to look for it and return 0.
>>
>> No, this is an error in the device tree. assigned-clock-rates depends on
>> assigned-clocks, so you must provide the latter if the former is present.
> 
> We were also checking it and in the Linux kernel it is handle like this.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/clk/clk-conf.c#n95
> 
> It means you can have rate assigned but not assigned-clocks property.
> 
> And yes in working case both should be present to work properly.

What is the use-case for this? It will not pass schema checking [1] anyway.

--Sean

[1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/clock/clock.yaml


More information about the U-Boot mailing list