Commit 543256d2 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Viresh Kumar

PM: opp: simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 907ed123
...@@ -2019,10 +2019,9 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev, ...@@ -2019,10 +2019,9 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
reg = regulator_get_optional(dev, names[i]); reg = regulator_get_optional(dev, names[i]);
if (IS_ERR(reg)) { if (IS_ERR(reg)) {
ret = PTR_ERR(reg); ret = dev_err_probe(dev, PTR_ERR(reg),
if (ret != -EPROBE_DEFER) "%s: no regulator (%s) found\n",
dev_err(dev, "%s: no regulator (%s) found: %d\n", __func__, names[i]);
__func__, names[i], ret);
goto free_regulators; goto free_regulators;
} }
...@@ -2168,11 +2167,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name) ...@@ -2168,11 +2167,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name)
/* Find clk for the device */ /* Find clk for the device */
opp_table->clk = clk_get(dev, name); opp_table->clk = clk_get(dev, name);
if (IS_ERR(opp_table->clk)) { if (IS_ERR(opp_table->clk)) {
ret = PTR_ERR(opp_table->clk); ret = dev_err_probe(dev, PTR_ERR(opp_table->clk),
if (ret != -EPROBE_DEFER) { "%s: Couldn't find clock\n", __func__);
dev_err(dev, "%s: Couldn't find clock: %d\n", __func__,
ret);
}
goto err; goto err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment