Skip to content

Commit 2746f13

Browse files
bijudasbebarino
authored andcommitted
clk: Fix undefined reference to `clk_rate_exclusive_{get,put}'
The COMMON_CLK config is not enabled in some of the architectures. This causes below build issues: pwm-rz-mtu3.c:(.text+0x114): undefined reference to `clk_rate_exclusive_put' pwm-rz-mtu3.c:(.text+0x32c): undefined reference to `clk_rate_exclusive_get' Fix these issues by moving clk_rate_exclusive_{get,put} inside COMMON_CLK code block, as clk.c is enabled by COMMON_CLK. Fixes: 55e9b8b ("clk: add clk_rate_exclusive api") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/all/202307251752.vLfmmhYm-lkp@intel.com/ Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230725175140.361479-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent dd1df82 commit 2746f13

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

include/linux/clk.h

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,39 @@ int clk_get_scaled_duty_cycle(struct clk *clk, unsigned int scale);
183183
*/
184184
bool clk_is_match(const struct clk *p, const struct clk *q);
185185

186+
/**
187+
* clk_rate_exclusive_get - get exclusivity over the rate control of a
188+
* producer
189+
* @clk: clock source
190+
*
191+
* This function allows drivers to get exclusive control over the rate of a
192+
* provider. It prevents any other consumer to execute, even indirectly,
193+
* opereation which could alter the rate of the provider or cause glitches
194+
*
195+
* If exlusivity is claimed more than once on clock, even by the same driver,
196+
* the rate effectively gets locked as exclusivity can't be preempted.
197+
*
198+
* Must not be called from within atomic context.
199+
*
200+
* Returns success (0) or negative errno.
201+
*/
202+
int clk_rate_exclusive_get(struct clk *clk);
203+
204+
/**
205+
* clk_rate_exclusive_put - release exclusivity over the rate control of a
206+
* producer
207+
* @clk: clock source
208+
*
209+
* This function allows drivers to release the exclusivity it previously got
210+
* from clk_rate_exclusive_get()
211+
*
212+
* The caller must balance the number of clk_rate_exclusive_get() and
213+
* clk_rate_exclusive_put() calls.
214+
*
215+
* Must not be called from within atomic context.
216+
*/
217+
void clk_rate_exclusive_put(struct clk *clk);
218+
186219
#else
187220

188221
static inline int clk_notifier_register(struct clk *clk,
@@ -236,6 +269,13 @@ static inline bool clk_is_match(const struct clk *p, const struct clk *q)
236269
return p == q;
237270
}
238271

272+
static inline int clk_rate_exclusive_get(struct clk *clk)
273+
{
274+
return 0;
275+
}
276+
277+
static inline void clk_rate_exclusive_put(struct clk *clk) {}
278+
239279
#endif
240280

241281
#ifdef CONFIG_HAVE_CLK_PREPARE
@@ -583,38 +623,6 @@ struct clk *devm_clk_get_optional_enabled(struct device *dev, const char *id);
583623
*/
584624
struct clk *devm_get_clk_from_child(struct device *dev,
585625
struct device_node *np, const char *con_id);
586-
/**
587-
* clk_rate_exclusive_get - get exclusivity over the rate control of a
588-
* producer
589-
* @clk: clock source
590-
*
591-
* This function allows drivers to get exclusive control over the rate of a
592-
* provider. It prevents any other consumer to execute, even indirectly,
593-
* opereation which could alter the rate of the provider or cause glitches
594-
*
595-
* If exlusivity is claimed more than once on clock, even by the same driver,
596-
* the rate effectively gets locked as exclusivity can't be preempted.
597-
*
598-
* Must not be called from within atomic context.
599-
*
600-
* Returns success (0) or negative errno.
601-
*/
602-
int clk_rate_exclusive_get(struct clk *clk);
603-
604-
/**
605-
* clk_rate_exclusive_put - release exclusivity over the rate control of a
606-
* producer
607-
* @clk: clock source
608-
*
609-
* This function allows drivers to release the exclusivity it previously got
610-
* from clk_rate_exclusive_get()
611-
*
612-
* The caller must balance the number of clk_rate_exclusive_get() and
613-
* clk_rate_exclusive_put() calls.
614-
*
615-
* Must not be called from within atomic context.
616-
*/
617-
void clk_rate_exclusive_put(struct clk *clk);
618626

619627
/**
620628
* clk_enable - inform the system when the clock source should be running.
@@ -974,14 +982,6 @@ static inline void clk_bulk_put_all(int num_clks, struct clk_bulk_data *clks) {}
974982

975983
static inline void devm_clk_put(struct device *dev, struct clk *clk) {}
976984

977-
978-
static inline int clk_rate_exclusive_get(struct clk *clk)
979-
{
980-
return 0;
981-
}
982-
983-
static inline void clk_rate_exclusive_put(struct clk *clk) {}
984-
985985
static inline int clk_enable(struct clk *clk)
986986
{
987987
return 0;

0 commit comments

Comments
 (0)