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

clk: Clean up suspend/resume coding style

The normal style is to use 'core' for struct clk_core pointers and to
directly access the core pointer from the clk_hw pointer when we're
within the common clk framework. Update the patches to make it a bit
easier to handle.

Signed-off-by: Stephen Boyd <sboyd@kernel.org>

+22 -20
+22 -20
drivers/clk/clk.c
··· 935 935 */ 936 936 void clk_gate_restore_context(struct clk_hw *hw) 937 937 { 938 - if (hw->clk->core->enable_count) 939 - hw->clk->core->ops->enable(hw); 938 + struct clk_core *core = hw->core; 939 + 940 + if (core->enable_count) 941 + core->ops->enable(hw); 940 942 else 941 - hw->clk->core->ops->disable(hw); 943 + core->ops->disable(hw); 942 944 } 943 945 EXPORT_SYMBOL_GPL(clk_gate_restore_context); 944 946 945 - static int _clk_save_context(struct clk_core *clk) 947 + static int clk_core_save_context(struct clk_core *core) 946 948 { 947 949 struct clk_core *child; 948 950 int ret = 0; 949 951 950 - hlist_for_each_entry(child, &clk->children, child_node) { 951 - ret = _clk_save_context(child); 952 + hlist_for_each_entry(child, &core->children, child_node) { 953 + ret = clk_core_save_context(child); 952 954 if (ret < 0) 953 955 return ret; 954 956 } 955 957 956 - if (clk->ops && clk->ops->save_context) 957 - ret = clk->ops->save_context(clk->hw); 958 + if (core->ops && core->ops->save_context) 959 + ret = core->ops->save_context(core->hw); 958 960 959 961 return ret; 960 962 } 961 963 962 - static void _clk_restore_context(struct clk_core *clk) 964 + static void clk_core_restore_context(struct clk_core *core) 963 965 { 964 966 struct clk_core *child; 965 967 966 - if (clk->ops && clk->ops->restore_context) 967 - clk->ops->restore_context(clk->hw); 968 + if (core->ops && core->ops->restore_context) 969 + core->ops->restore_context(core->hw); 968 970 969 - hlist_for_each_entry(child, &clk->children, child_node) 970 - _clk_restore_context(child); 971 + hlist_for_each_entry(child, &core->children, child_node) 972 + clk_core_restore_context(child); 971 973 } 972 974 973 975 /** ··· 985 983 int ret; 986 984 987 985 hlist_for_each_entry(clk, &clk_root_list, child_node) { 988 - ret = _clk_save_context(clk); 986 + ret = clk_core_save_context(clk); 989 987 if (ret < 0) 990 988 return ret; 991 989 } 992 990 993 991 hlist_for_each_entry(clk, &clk_orphan_list, child_node) { 994 - ret = _clk_save_context(clk); 992 + ret = clk_core_save_context(clk); 995 993 if (ret < 0) 996 994 return ret; 997 995 } ··· 1008 1006 */ 1009 1007 void clk_restore_context(void) 1010 1008 { 1011 - struct clk_core *clk; 1009 + struct clk_core *core; 1012 1010 1013 - hlist_for_each_entry(clk, &clk_root_list, child_node) 1014 - _clk_restore_context(clk); 1011 + hlist_for_each_entry(core, &clk_root_list, child_node) 1012 + clk_core_restore_context(core); 1015 1013 1016 - hlist_for_each_entry(clk, &clk_orphan_list, child_node) 1017 - _clk_restore_context(clk); 1014 + hlist_for_each_entry(core, &clk_orphan_list, child_node) 1015 + clk_core_restore_context(core); 1018 1016 } 1019 1017 EXPORT_SYMBOL_GPL(clk_restore_context); 1020 1018