Skip to content

Commit

Permalink
clk: qcom: Return error pointers for unimplemented clocks
Browse files Browse the repository at this point in the history
Not all clocks are implemented but client drivers can still
request them. Currently we will return a NULL pointer to them if
the clock isn't implemented in software but NULL pointers are
valid clock pointers. Return an error pointer so that driver's
don't proceed without a clock they may actually need.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
  • Loading branch information
Stephen Boyd authored and Mike Turquette committed May 29, 2014
1 parent c685841 commit 9ec2749
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/clk/qcom/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ int qcom_cc_probe(struct platform_device *pdev, const struct qcom_cc_desc *desc)
data->clk_num = num_clks;

for (i = 0; i < num_clks; i++) {
if (!rclks[i])
if (!rclks[i]) {
clks[i] = ERR_PTR(-ENOENT);
continue;
}
clk = devm_clk_register_regmap(dev, rclks[i]);
if (IS_ERR(clk))
return PTR_ERR(clk);
Expand Down

0 comments on commit 9ec2749

Please sign in to comment.