opp: Change return type of devm_pm_opp_register_set_opp_helper()

Make devm_pm_opp_register_set_opp_helper() 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>
This commit is contained in:
Dmitry Osipenko 2021-03-14 19:33:58 +03:00 committed by Viresh Kumar
parent 3d5cfbb695
commit c41c8a3485
2 changed files with 9 additions and 16 deletions

View File

@ -2295,25 +2295,19 @@ static void devm_pm_opp_unregister_set_opp_helper(void *data)
* *
* This is a resource-managed version of dev_pm_opp_register_set_opp_helper(). * This is a resource-managed version of dev_pm_opp_register_set_opp_helper().
* *
* Return: pointer to 'struct opp_table' on success and errorno otherwise. * Return: 0 on success and errorno otherwise.
*/ */
struct opp_table * int devm_pm_opp_register_set_opp_helper(struct device *dev,
devm_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data))
int (*set_opp)(struct dev_pm_set_opp_data *data))
{ {
struct opp_table *opp_table; struct opp_table *opp_table;
int err;
opp_table = dev_pm_opp_register_set_opp_helper(dev, set_opp); opp_table = dev_pm_opp_register_set_opp_helper(dev, set_opp);
if (IS_ERR(opp_table)) if (IS_ERR(opp_table))
return opp_table; return PTR_ERR(opp_table);
err = devm_add_action_or_reset(dev, devm_pm_opp_unregister_set_opp_helper, return devm_add_action_or_reset(dev, devm_pm_opp_unregister_set_opp_helper,
opp_table); opp_table);
if (err)
return ERR_PTR(err);
return opp_table;
} }
EXPORT_SYMBOL_GPL(devm_pm_opp_register_set_opp_helper); EXPORT_SYMBOL_GPL(devm_pm_opp_register_set_opp_helper);

View File

@ -155,7 +155,7 @@ void dev_pm_opp_put_clkname(struct opp_table *opp_table);
int devm_pm_opp_set_clkname(struct device *dev, const char *name); int devm_pm_opp_set_clkname(struct device *dev, const char *name);
struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data)); struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table); void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);
struct opp_table *devm_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data)); int devm_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs); struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs);
void dev_pm_opp_detach_genpd(struct opp_table *opp_table); void dev_pm_opp_detach_genpd(struct opp_table *opp_table);
struct opp_table *devm_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs); struct opp_table *devm_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs);
@ -337,11 +337,10 @@ static inline struct opp_table *dev_pm_opp_register_set_opp_helper(struct device
static inline void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table) {} static inline void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table) {}
static inline struct opp_table * static inline int devm_pm_opp_register_set_opp_helper(struct device *dev,
devm_pm_opp_register_set_opp_helper(struct device *dev,
int (*set_opp)(struct dev_pm_set_opp_data *data)) int (*set_opp)(struct dev_pm_set_opp_data *data))
{ {
return ERR_PTR(-EOPNOTSUPP); return -EOPNOTSUPP;
} }
static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name) static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name)