Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365308
b: refs/heads/master
c: f363e21
h: refs/heads/master
v: v3
  • Loading branch information
Mike Turquette committed Apr 12, 2013
1 parent cc6af80 commit a4c580a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3a1c7be8361e2fbb6affbdb19de47ca48d6c402
refs/heads/master: f363e215931ecc8077b6f6ee6d39d9ffaf1c3bd0
17 changes: 13 additions & 4 deletions trunk/drivers/clk/clk-composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,26 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
}

if (rate_hw && rate_ops) {
if (!rate_ops->recalc_rate || !rate_ops->round_rate ||
!rate_ops->set_rate) {
if (!rate_ops->recalc_rate) {
clk = ERR_PTR(-EINVAL);
goto err;
}

/* .round_rate is a prerequisite for .set_rate */
if (rate_ops->round_rate) {
clk_composite_ops->round_rate = clk_composite_round_rate;
if (rate_ops->set_rate) {
clk_composite_ops->set_rate = clk_composite_set_rate;
}
} else {
WARN(rate_ops->set_rate,
"%s: missing round_rate op is required\n",
__func__);
}

composite->rate_hw = rate_hw;
composite->rate_ops = rate_ops;
clk_composite_ops->recalc_rate = clk_composite_recalc_rate;
clk_composite_ops->round_rate = clk_composite_round_rate;
clk_composite_ops->set_rate = clk_composite_set_rate;
}

if (gate_hw && gate_ops) {
Expand Down

0 comments on commit a4c580a

Please sign in to comment.