@@ -1560,8 +1560,6 @@ late_initcall_sync(clk_disable_unused);
15601560static int clk_core_determine_round_nolock (struct clk_core * core ,
15611561 struct clk_rate_request * req )
15621562{
1563- long rate ;
1564-
15651563 lockdep_assert_held (& prepare_lock );
15661564
15671565 if (!core )
@@ -1591,13 +1589,6 @@ static int clk_core_determine_round_nolock(struct clk_core *core,
15911589 req -> rate = core -> rate ;
15921590 } else if (core -> ops -> determine_rate ) {
15931591 return core -> ops -> determine_rate (core -> hw , req );
1594- } else if (core -> ops -> round_rate ) {
1595- rate = core -> ops -> round_rate (core -> hw , req -> rate ,
1596- & req -> best_parent_rate );
1597- if (rate < 0 )
1598- return rate ;
1599-
1600- req -> rate = rate ;
16011592 } else {
16021593 return - EINVAL ;
16031594 }
@@ -1682,7 +1673,7 @@ EXPORT_SYMBOL_GPL(clk_hw_forward_rate_request);
16821673
16831674static bool clk_core_can_round (struct clk_core * const core )
16841675{
1685- return core -> ops -> determine_rate || core -> ops -> round_rate ;
1676+ return core -> ops -> determine_rate ;
16861677}
16871678
16881679static int clk_core_round_rate_nolock (struct clk_core * core ,
@@ -1750,11 +1741,11 @@ EXPORT_SYMBOL_GPL(__clk_determine_rate);
17501741 * use.
17511742 *
17521743 * Context: prepare_lock must be held.
1753- * For clk providers to call from within clk_ops such as .round_rate,
1744+ * For clk providers to call from within clk_ops such as
17541745 * .determine_rate.
17551746 *
1756- * Return: returns rounded rate of hw clk if clk supports round_rate operation
1757- * else returns the parent rate.
1747+ * Return: returns rounded rate of hw clk if clk supports determine_rate
1748+ * operation; else returns the parent rate.
17581749 */
17591750unsigned long clk_hw_round_rate (struct clk_hw * hw , unsigned long rate )
17601751{
@@ -2569,12 +2560,13 @@ static int clk_core_set_rate_nolock(struct clk_core *core,
25692560 *
25702561 * Setting the CLK_SET_RATE_PARENT flag allows the rate change operation to
25712562 * propagate up to clk's parent; whether or not this happens depends on the
2572- * outcome of clk's .round_rate implementation. If *parent_rate is unchanged
2573- * after calling .round_rate then upstream parent propagation is ignored. If
2574- * *parent_rate comes back with a new rate for clk's parent then we propagate
2575- * up to clk's parent and set its rate. Upward propagation will continue
2576- * until either a clk does not support the CLK_SET_RATE_PARENT flag or
2577- * .round_rate stops requesting changes to clk's parent_rate.
2563+ * outcome of clk's .determine_rate implementation. If req->best_parent_rate
2564+ * is unchanged after calling .determine_rate then upstream parent propagation
2565+ * is ignored. If req->best_parent_rate comes back with a new rate for clk's
2566+ * parent then we propagate up to clk's parent and set its rate. Upward
2567+ * propagation will continue until either a clk does not support the
2568+ * CLK_SET_RATE_PARENT flag or .determine_rate stops requesting changes to
2569+ * clk's parent_rate.
25782570 *
25792571 * Rate changes are accomplished via tree traversal that also recalculates the
25802572 * rates for the clocks and fires off POST_RATE_CHANGE notifiers.
@@ -2703,8 +2695,6 @@ static int clk_set_rate_range_nolock(struct clk *clk,
27032695 * FIXME:
27042696 * There is a catch. It may fail for the usual reason (clock
27052697 * broken, clock protected, etc) but also because:
2706- * - round_rate() was not favorable and fell on the wrong
2707- * side of the boundary
27082698 * - the determine_rate() callback does not really check for
27092699 * this corner case when determining the rate
27102700 */
@@ -3915,10 +3905,9 @@ static int __clk_core_init(struct clk_core *core)
39153905 }
39163906
39173907 /* check that clk_ops are sane. See Documentation/driver-api/clk.rst */
3918- if (core -> ops -> set_rate &&
3919- !((core -> ops -> round_rate || core -> ops -> determine_rate ) &&
3920- core -> ops -> recalc_rate )) {
3921- pr_err ("%s: %s must implement .round_rate or .determine_rate in addition to .recalc_rate\n" ,
3908+ if (core -> ops -> set_rate && !core -> ops -> determine_rate &&
3909+ core -> ops -> recalc_rate ) {
3910+ pr_err ("%s: %s must implement .determine_rate in addition to .recalc_rate\n" ,
39223911 __func__ , core -> name );
39233912 ret = - EINVAL ;
39243913 goto out ;
0 commit comments