Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stephen Boyd and committed by
Michael Turquette
e7df6f6e c1628a2c

+15 -14
+8 -7
drivers/clk/clk.c
··· 278 278 } 279 279 EXPORT_SYMBOL_GPL(__clk_get_name); 280 280 281 - const char *clk_hw_get_name(struct clk_hw *hw) 281 + const char *clk_hw_get_name(const struct clk_hw *hw) 282 282 { 283 283 return hw->core->name; 284 284 } ··· 290 290 } 291 291 EXPORT_SYMBOL_GPL(__clk_get_hw); 292 292 293 - unsigned int clk_hw_get_num_parents(struct clk_hw *hw) 293 + unsigned int clk_hw_get_num_parents(const struct clk_hw *hw) 294 294 { 295 295 return hw->core->num_parents; 296 296 } 297 297 EXPORT_SYMBOL_GPL(clk_hw_get_num_parents); 298 298 299 - struct clk_hw *clk_hw_get_parent(struct clk_hw *hw) 299 + struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw) 300 300 { 301 301 return hw->core->parent ? hw->core->parent->hw : NULL; 302 302 } ··· 359 359 return core->parents[index]; 360 360 } 361 361 362 - struct clk_hw *clk_hw_get_parent_by_index(struct clk_hw *hw, unsigned int index) 362 + struct clk_hw * 363 + clk_hw_get_parent_by_index(const struct clk_hw *hw, unsigned int index) 363 364 { 364 365 struct clk_core *parent; 365 366 ··· 396 395 return ret; 397 396 } 398 397 399 - unsigned long clk_hw_get_rate(struct clk_hw *hw) 398 + unsigned long clk_hw_get_rate(const struct clk_hw *hw) 400 399 { 401 400 return clk_core_get_rate_nolock(hw->core); 402 401 } ··· 416 415 } 417 416 EXPORT_SYMBOL_GPL(__clk_get_flags); 418 417 419 - unsigned long clk_hw_get_flags(struct clk_hw *hw) 418 + unsigned long clk_hw_get_flags(const struct clk_hw *hw) 420 419 { 421 420 return hw->core->flags; 422 421 } 423 422 EXPORT_SYMBOL_GPL(clk_hw_get_flags); 424 423 425 - bool clk_hw_is_prepared(struct clk_hw *hw) 424 + bool clk_hw_is_prepared(const struct clk_hw *hw) 426 425 { 427 426 return clk_core_is_prepared(hw->core); 428 427 }
+7 -7
include/linux/clk-provider.h
··· 607 607 608 608 /* helper functions */ 609 609 const char *__clk_get_name(struct clk *clk); 610 - const char *clk_hw_get_name(struct clk_hw *hw); 610 + const char *clk_hw_get_name(const struct clk_hw *hw); 611 611 struct clk_hw *__clk_get_hw(struct clk *clk); 612 - unsigned int clk_hw_get_num_parents(struct clk_hw *hw); 613 - struct clk_hw *clk_hw_get_parent(struct clk_hw *hw); 614 - struct clk_hw *clk_hw_get_parent_by_index(struct clk_hw *hw, 612 + unsigned int clk_hw_get_num_parents(const struct clk_hw *hw); 613 + struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw); 614 + struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw, 615 615 unsigned int index); 616 616 unsigned int __clk_get_enable_count(struct clk *clk); 617 - unsigned long clk_hw_get_rate(struct clk_hw *hw); 617 + unsigned long clk_hw_get_rate(const struct clk_hw *hw); 618 618 unsigned long __clk_get_flags(struct clk *clk); 619 - unsigned long clk_hw_get_flags(struct clk_hw *hw); 620 - bool clk_hw_is_prepared(struct clk_hw *hw); 619 + unsigned long clk_hw_get_flags(const struct clk_hw *hw); 620 + bool clk_hw_is_prepared(const struct clk_hw *hw); 621 621 bool __clk_is_enabled(struct clk *clk); 622 622 struct clk *__clk_lookup(const char *name); 623 623 int __clk_mux_determine_rate(struct clk_hw *hw,