aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2015-08-12 16:04:56 -0400
committerMichael Turquette <mturquette@baylibre.com>2015-08-24 19:49:11 -0400
commite7df6f6e21883d7e8b3ad4641c911da8314ef283 (patch)
treef8093aca607b3d00865e3d9b4264d3e90d2c93d2
parentc1628a2c416da947f5afac615d53189250fa49cb (diff)
clk: Constify clk_hw argument to provider APIs
We don't modify the clk_hw argument in these functions, so it's safe to mark it as const. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r--drivers/clk/clk.c15
-rw-r--r--include/linux/clk-provider.h14
2 files changed, 15 insertions, 14 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 128ad748b682..8e6688d1ecbd 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -278,7 +278,7 @@ const char *__clk_get_name(struct clk *clk)
278} 278}
279EXPORT_SYMBOL_GPL(__clk_get_name); 279EXPORT_SYMBOL_GPL(__clk_get_name);
280 280
281const char *clk_hw_get_name(struct clk_hw *hw) 281const char *clk_hw_get_name(const struct clk_hw *hw)
282{ 282{
283 return hw->core->name; 283 return hw->core->name;
284} 284}
@@ -290,13 +290,13 @@ struct clk_hw *__clk_get_hw(struct clk *clk)
290} 290}
291EXPORT_SYMBOL_GPL(__clk_get_hw); 291EXPORT_SYMBOL_GPL(__clk_get_hw);
292 292
293unsigned int clk_hw_get_num_parents(struct clk_hw *hw) 293unsigned int clk_hw_get_num_parents(const struct clk_hw *hw)
294{ 294{
295 return hw->core->num_parents; 295 return hw->core->num_parents;
296} 296}
297EXPORT_SYMBOL_GPL(clk_hw_get_num_parents); 297EXPORT_SYMBOL_GPL(clk_hw_get_num_parents);
298 298
299struct clk_hw *clk_hw_get_parent(struct clk_hw *hw) 299struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw)
300{ 300{
301 return hw->core->parent ? hw->core->parent->hw : NULL; 301 return hw->core->parent ? hw->core->parent->hw : NULL;
302} 302}
@@ -359,7 +359,8 @@ static struct clk_core *clk_core_get_parent_by_index(struct clk_core *core,
359 return core->parents[index]; 359 return core->parents[index];
360} 360}
361 361
362struct clk_hw *clk_hw_get_parent_by_index(struct clk_hw *hw, unsigned int index) 362struct clk_hw *
363clk_hw_get_parent_by_index(const struct clk_hw *hw, unsigned int index)
363{ 364{
364 struct clk_core *parent; 365 struct clk_core *parent;
365 366
@@ -395,7 +396,7 @@ out:
395 return ret; 396 return ret;
396} 397}
397 398
398unsigned long clk_hw_get_rate(struct clk_hw *hw) 399unsigned long clk_hw_get_rate(const struct clk_hw *hw)
399{ 400{
400 return clk_core_get_rate_nolock(hw->core); 401 return clk_core_get_rate_nolock(hw->core);
401} 402}
@@ -415,13 +416,13 @@ unsigned long __clk_get_flags(struct clk *clk)
415} 416}
416EXPORT_SYMBOL_GPL(__clk_get_flags); 417EXPORT_SYMBOL_GPL(__clk_get_flags);
417 418
418unsigned long clk_hw_get_flags(struct clk_hw *hw) 419unsigned long clk_hw_get_flags(const struct clk_hw *hw)
419{ 420{
420 return hw->core->flags; 421 return hw->core->flags;
421} 422}
422EXPORT_SYMBOL_GPL(clk_hw_get_flags); 423EXPORT_SYMBOL_GPL(clk_hw_get_flags);
423 424
424bool clk_hw_is_prepared(struct clk_hw *hw) 425bool clk_hw_is_prepared(const struct clk_hw *hw)
425{ 426{
426 return clk_core_is_prepared(hw->core); 427 return clk_core_is_prepared(hw->core);
427} 428}
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 0d3128fbc14e..3ecc07d0da77 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -607,17 +607,17 @@ void devm_clk_unregister(struct device *dev, struct clk *clk);
607 607
608/* helper functions */ 608/* helper functions */
609const char *__clk_get_name(struct clk *clk); 609const char *__clk_get_name(struct clk *clk);
610const char *clk_hw_get_name(struct clk_hw *hw); 610const char *clk_hw_get_name(const struct clk_hw *hw);
611struct clk_hw *__clk_get_hw(struct clk *clk); 611struct clk_hw *__clk_get_hw(struct clk *clk);
612unsigned int clk_hw_get_num_parents(struct clk_hw *hw); 612unsigned int clk_hw_get_num_parents(const struct clk_hw *hw);
613struct clk_hw *clk_hw_get_parent(struct clk_hw *hw); 613struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);
614struct clk_hw *clk_hw_get_parent_by_index(struct clk_hw *hw, 614struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw,
615 unsigned int index); 615 unsigned int index);
616unsigned int __clk_get_enable_count(struct clk *clk); 616unsigned int __clk_get_enable_count(struct clk *clk);
617unsigned long clk_hw_get_rate(struct clk_hw *hw); 617unsigned long clk_hw_get_rate(const struct clk_hw *hw);
618unsigned long __clk_get_flags(struct clk *clk); 618unsigned long __clk_get_flags(struct clk *clk);
619unsigned long clk_hw_get_flags(struct clk_hw *hw); 619unsigned long clk_hw_get_flags(const struct clk_hw *hw);
620bool clk_hw_is_prepared(struct clk_hw *hw); 620bool clk_hw_is_prepared(const struct clk_hw *hw);
621bool __clk_is_enabled(struct clk *clk); 621bool __clk_is_enabled(struct clk *clk);
622struct clk *__clk_lookup(const char *name); 622struct clk *__clk_lookup(const char *name);
623int __clk_mux_determine_rate(struct clk_hw *hw, 623int __clk_mux_determine_rate(struct clk_hw *hw,