req->max_rate = old_req->max_rate;
}
------int clk_mux_determine_rate_flags(struct clk_hw *hw,
------ struct clk_rate_request *req,
------ unsigned long flags)
++++++static int
++++++clk_core_determine_rate_no_reparent(struct clk_hw *hw,
++++++ struct clk_rate_request *req)
{
------ struct clk_core *core = hw->core, *parent, *best_parent = NULL;
------ int i, num_parents, ret;
------ unsigned long best = 0;
-- ---
-- --- /* if NO_REPARENT flag set, pass through to current parent */
-- --- if (core->flags & CLK_SET_RATE_NO_REPARENT) {
-- --- parent = core->parent;
-- --- if (core->flags & CLK_SET_RATE_PARENT) {
-- --- struct clk_rate_request parent_req;
++++++ struct clk_core *core = hw->core;
++++++ struct clk_core *parent = core->parent;
++++++ unsigned long best;
++++++ int ret;
-- --- if (!parent) {
-- --- req->rate = 0;
-- --- return 0;
-- --- }
- /* if NO_REPARENT flag set, pass through to current parent */
- if (core->flags & CLK_SET_RATE_NO_REPARENT) {
- parent = core->parent;
- if (core->flags & CLK_SET_RATE_PARENT) {
- struct clk_rate_request parent_req;
++++++ if (core->flags & CLK_SET_RATE_PARENT) {
++++++ struct clk_rate_request parent_req;
-- --- clk_core_forward_rate_req(core, req, parent, &parent_req, req->rate);
- if (!parent) {
- req->rate = 0;
- return 0;
- }
++++++ if (!parent) {
++++++ req->rate = 0;
++++++ return 0;
++++++ }
-- --- trace_clk_rate_request_start(&parent_req);
- clk_core_forward_rate_req(core, req, parent, &parent_req, req->rate);
++++++ clk_core_forward_rate_req(core, req, parent, &parent_req,
++++++ req->rate);
- trace_clk_rate_request_start(&parent_req);
-
------ ret = clk_core_round_rate_nolock(parent, &parent_req);
------ if (ret)
------ return ret;
++++++ trace_clk_rate_request_start(&parent_req);
------ trace_clk_rate_request_done(&parent_req);
++++++ ret = clk_core_round_rate_nolock(parent, &parent_req);
++++++ if (ret)
++++++ return ret;
------ best = parent_req.rate;
------ } else if (parent) {
------ best = clk_core_get_rate_nolock(parent);
------ } else {
------ best = clk_core_get_rate_nolock(core);
------ }
++++++ trace_clk_rate_request_done(&parent_req);
------ goto out;
++++++ best = parent_req.rate;
++++++ } else if (parent) {
++++++ best = clk_core_get_rate_nolock(parent);
++++++ } else {
++++++ best = clk_core_get_rate_nolock(core);
}
++++++ req->best_parent_rate = best;
++++++ req->rate = best;
++++++
++++++ return 0;
++++++}
++++++
++++++int clk_mux_determine_rate_flags(struct clk_hw *hw,
++++++ struct clk_rate_request *req,
++++++ unsigned long flags)
++++++{
++++++ struct clk_core *core = hw->core, *parent, *best_parent = NULL;
++++++ int i, num_parents, ret;
++++++ unsigned long best = 0;
++++++
++++++ /* if NO_REPARENT flag set, pass through to current parent */
++++++ if (core->flags & CLK_SET_RATE_NO_REPARENT)
++++++ return clk_core_determine_rate_no_reparent(hw, req);
++++++
/* find the parent that can provide the fastest rate <= rate */
num_parents = core->num_parents;
for (i = 0; i < num_parents; i++) {