Quoting Manivannan Sadhasivam (2018-03-17 03:09:48) > + > +static int clk_val_best(struct clk_hw *hw, unsigned long rate, > + unsigned long *best_parent_rate) > +{ [...] > + } > + > + parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), > + try_parent_rate); > + cur_rate = DIV_ROUND_UP(parent_rate, clkt->div) * clkt->mul; > + if (cur_rate <= rate && cur_rate > best) { > + bestval = clkt->val; > + best = cur_rate; > + *best_parent_rate = parent_rate; > + } > + } > + > + if (!bestval) { > + bestval = _get_table_maxval(clkt); > + *best_parent_rate = clk_hw_round_rate( > + clk_hw_get_parent(hw), 1); > + } > + > + return bestval; Also, if this is largely copy/paste from the factor clk code then perhaps those functions can be exported to here and reused instead of copy/paste. > +} -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html