From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Burton Date: Fri, 9 Sep 2016 09:01:52 +0100 Subject: [U-Boot] [PATCH v7 01/12] clk: Use dummy clk_get_by_* functions when CONFIG_CLK is disabled In-Reply-To: References: <20160908064739.25313-1-paul.burton@imgtec.com> <20160908064739.25313-2-paul.burton@imgtec.com> Message-ID: <4fdd6641-b13c-7211-79d1-e187f14ba86f@imgtec.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/09/16 04:15, Masahiro Yamada wrote: > 2016-09-08 15:47 GMT+09:00 Paul Burton : >> 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