diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2021-03-14 17:33:59 +0100 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2021-03-16 05:44:11 +0100 |
commit | 9edf48a4bfb75456f7612972a4750a12d8a83702 (patch) | |
tree | 81a5714d29bf5a85338dfc5fde3cacdbc059ea8e /drivers/opp | |
parent | opp: Change return type of devm_pm_opp_register_set_opp_helper() (diff) | |
download | linux-9edf48a4bfb75456f7612972a4750a12d8a83702.tar.xz linux-9edf48a4bfb75456f7612972a4750a12d8a83702.zip |
opp: Change return type of devm_pm_opp_attach_genpd()
Make devm_pm_opp_attach_genpd() to return error code instead of
opp_table pointer in order to have return type consistent with the
other resource-managed OPP helpers.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r-- | drivers/opp/core.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 89c3b0b219ce..e366218d6736 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2460,25 +2460,19 @@ static void devm_pm_opp_detach_genpd(void *data) * * This is a resource-managed version of dev_pm_opp_attach_genpd(). * - * Return: pointer to 'struct opp_table' on success and errorno otherwise. + * Return: 0 on success and errorno otherwise. */ -struct opp_table * -devm_pm_opp_attach_genpd(struct device *dev, const char **names, - struct device ***virt_devs) +int devm_pm_opp_attach_genpd(struct device *dev, const char **names, + struct device ***virt_devs) { struct opp_table *opp_table; - int err; opp_table = dev_pm_opp_attach_genpd(dev, names, virt_devs); if (IS_ERR(opp_table)) - return opp_table; - - err = devm_add_action_or_reset(dev, devm_pm_opp_detach_genpd, - opp_table); - if (err) - return ERR_PTR(err); + return PTR_ERR(opp_table); - return opp_table; + return devm_add_action_or_reset(dev, devm_pm_opp_detach_genpd, + opp_table); } EXPORT_SYMBOL_GPL(devm_pm_opp_attach_genpd); |