[U-Boot] [PATCH v7 01/12] clk: Use dummy clk_get_by_* functions when CONFIG_CLK is disabled

Paul Burton paul.burton at imgtec.com
Fri Sep 9 10:01:52 CEST 2016


On 09/09/16 04:15, Masahiro Yamada wrote:
> 2016-09-08 15:47 GMT+09:00 Paul Burton <paul.burton at imgtec.com>:
>> The implementations of clk_get_by_index & clk_get_by_name are only
>> available when CONFIG_CLK is enabled.
> 
> Unless I am missing something,
> I think this statement also applies to other clk API functions
> such as clk_request(), clk_free(), clk_get_rate(), etc.

Hi Masahiro,

Yes, I agree. To be clear though, this patch doesn't add any new stub
functions it simply makes the conditions for the existing ones being
provided match the conditions for the real implementations not being
provided.

>> Provide the dummies when this is
>> not the case in order to avoid build failures.
> 
> Why are other functions OK without dummy stubs?

In general, I presume because they aren't used.

In the specific case I'm using clk_get_by_index for
(drivers/serial/ns16550.c in patch 2 of this series) the fact that the
dummy clk_get_by_index always returns an error will cause the compiler
to optimise out a call to clk_get_rate so any dummy implementation
provided for it wouldn't really get used.

Thanks,
    Paul


More information about the U-Boot mailing list