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

clk: versaclock7: convert from round_rate() to determine_rate()

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>

+18 -12
+18 -12
drivers/clk/clk-versaclock7.c
··· 900 900 return fod_rate; 901 901 } 902 902 903 - static long vc7_fod_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) 903 + static int vc7_fod_determine_rate(struct clk_hw *hw, 904 + struct clk_rate_request *req) 904 905 { 905 906 struct vc7_fod_data *fod = container_of(hw, struct vc7_fod_data, hw); 906 907 unsigned long fod_rate; 907 908 908 909 pr_debug("%s - %s: requested rate: %lu, parent_rate: %lu\n", 909 - __func__, clk_hw_get_name(hw), rate, *parent_rate); 910 + __func__, clk_hw_get_name(hw), req->rate, req->best_parent_rate); 910 911 911 - vc7_calc_fod_divider(rate, *parent_rate, 912 + vc7_calc_fod_divider(req->rate, req->best_parent_rate, 912 913 &fod->fod_1st_int, &fod->fod_2nd_int, &fod->fod_frac); 913 - fod_rate = vc7_calc_fod_2nd_stage_rate(*parent_rate, fod->fod_1st_int, 914 + fod_rate = vc7_calc_fod_2nd_stage_rate(req->best_parent_rate, fod->fod_1st_int, 914 915 fod->fod_2nd_int, fod->fod_frac); 915 916 916 917 pr_debug("%s - %s: fod_1st_int: %u, fod_2nd_int: %u, fod_frac: %llu\n", ··· 919 918 fod->fod_1st_int, fod->fod_2nd_int, fod->fod_frac); 920 919 pr_debug("%s - %s rate: %lu\n", __func__, clk_hw_get_name(hw), fod_rate); 921 920 922 - return fod_rate; 921 + req->rate = fod_rate; 922 + 923 + return 0; 923 924 } 924 925 925 926 static int vc7_fod_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) ··· 955 952 956 953 static const struct clk_ops vc7_fod_ops = { 957 954 .recalc_rate = vc7_fod_recalc_rate, 958 - .round_rate = vc7_fod_round_rate, 955 + .determine_rate = vc7_fod_determine_rate, 959 956 .set_rate = vc7_fod_set_rate, 960 957 }; 961 958 ··· 981 978 return iod_rate; 982 979 } 983 980 984 - static long vc7_iod_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) 981 + static int vc7_iod_determine_rate(struct clk_hw *hw, 982 + struct clk_rate_request *req) 985 983 { 986 984 struct vc7_iod_data *iod = container_of(hw, struct vc7_iod_data, hw); 987 985 unsigned long iod_rate; 988 986 989 987 pr_debug("%s - %s: requested rate: %lu, parent_rate: %lu\n", 990 - __func__, clk_hw_get_name(hw), rate, *parent_rate); 988 + __func__, clk_hw_get_name(hw), req->rate, req->best_parent_rate); 991 989 992 - vc7_calc_iod_divider(rate, *parent_rate, &iod->iod_int); 993 - iod_rate = div64_u64(*parent_rate, iod->iod_int); 990 + vc7_calc_iod_divider(req->rate, req->best_parent_rate, &iod->iod_int); 991 + iod_rate = div64_u64(req->best_parent_rate, iod->iod_int); 994 992 995 993 pr_debug("%s - %s: iod_int: %u\n", __func__, clk_hw_get_name(hw), iod->iod_int); 996 994 pr_debug("%s - %s rate: %ld\n", __func__, clk_hw_get_name(hw), iod_rate); 997 995 998 - return iod_rate; 996 + req->rate = iod_rate; 997 + 998 + return 0; 999 999 } 1000 1000 1001 1001 static int vc7_iod_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) ··· 1029 1023 1030 1024 static const struct clk_ops vc7_iod_ops = { 1031 1025 .recalc_rate = vc7_iod_recalc_rate, 1032 - .round_rate = vc7_iod_round_rate, 1026 + .determine_rate = vc7_iod_determine_rate, 1033 1027 .set_rate = vc7_iod_set_rate, 1034 1028 }; 1035 1029