diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2022-04-08 13:10:52 +0200 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2022-04-11 04:53:21 +0200 |
commit | 543256d239b4156bf5817049fb92138f6661f15f (patch) | |
tree | 62b67daad5b9b6454db3be2335be2ff0a5da38e6 /drivers/opp | |
parent | OPP: call of_node_put() on error path in _bandwidth_supported() (diff) | |
download | linux-543256d239b4156bf5817049fb92138f6661f15f.tar.xz linux-543256d239b4156bf5817049fb92138f6661f15f.zip |
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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r-- | drivers/opp/core.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 740407252298..2945f3c1ce09 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2019,10 +2019,9 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev, for (i = 0; i < count; i++) { reg = regulator_get_optional(dev, names[i]); if (IS_ERR(reg)) { - ret = PTR_ERR(reg); - if (ret != -EPROBE_DEFER) - dev_err(dev, "%s: no regulator (%s) found: %d\n", - __func__, names[i], ret); + ret = dev_err_probe(dev, PTR_ERR(reg), + "%s: no regulator (%s) found\n", + __func__, names[i]); goto free_regulators; } @@ -2168,11 +2167,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name) /* Find clk for the device */ opp_table->clk = clk_get(dev, name); if (IS_ERR(opp_table->clk)) { - ret = PTR_ERR(opp_table->clk); - if (ret != -EPROBE_DEFER) { - dev_err(dev, "%s: Couldn't find clock: %d\n", __func__, - ret); - } + ret = dev_err_probe(dev, PTR_ERR(opp_table->clk), + "%s: Couldn't find clock\n", __func__); goto err; } |