Messages in this thread Patch in this message | | | From | Viresh Kumar <> | Subject | [PATCH 30/31] OPP: Remove dev_pm_opp_set_prop_name() and friends | Date | Thu, 26 May 2022 17:12:29 +0530 |
| |
Now that everyone has migrated to dev_pm_opp_set_config(), remove the public interface for dev_pm_opp_set_prop_name() and friends.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- drivers/opp/core.c | 54 +++++++++++++++--------------------------- include/linux/pm_opp.h | 9 ------- 2 files changed, 19 insertions(+), 44 deletions(-)
diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 69c6cf6a0bcc..e6c76b90dbf7 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1993,7 +1993,7 @@ static void _opp_put_supported_hw(struct opp_table *opp_table) } /** - * dev_pm_opp_set_prop_name() - Set prop-extn name + * _opp_set_prop_name() - Set prop-extn name * @dev: Device for which the prop-name has to be set. * @name: name to postfix to properties. * @@ -2002,50 +2002,33 @@ static void _opp_put_supported_hw(struct opp_table *opp_table) * which the extension will apply are opp-microvolt and opp-microamp. OPP core * should postfix the property name with -<name> while looking for them. */ -struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name) +static int _opp_set_prop_name(struct opp_table *opp_table, const char *name) { - struct opp_table *opp_table; - - opp_table = _add_opp_table(dev, false); - if (IS_ERR(opp_table)) - return opp_table; - - /* Make sure there are no concurrent readers while updating opp_table */ - WARN_ON(!list_empty(&opp_table->opp_list)); - /* Another CPU that shares the OPP table has set the property ? */ - if (opp_table->prop_name) - return opp_table; - - opp_table->prop_name = kstrdup(name, GFP_KERNEL); if (!opp_table->prop_name) { - dev_pm_opp_put_opp_table(opp_table); - return ERR_PTR(-ENOMEM); + opp_table->prop_name = kstrdup(name, GFP_KERNEL); + if (!opp_table->prop_name) + return -ENOMEM; } - return opp_table; + return 0; } -EXPORT_SYMBOL_GPL(dev_pm_opp_set_prop_name); /** - * dev_pm_opp_put_prop_name() - Releases resources blocked for prop-name - * @opp_table: OPP table returned by dev_pm_opp_set_prop_name(). + * _opp_put_prop_name() - Releases resources blocked for prop-name + * @opp_table: OPP table returned by _opp_set_prop_name(). * * This is required only for the V2 bindings, and is called for a matching - * dev_pm_opp_set_prop_name(). Until this is called, the opp_table structure + * _opp_set_prop_name(). Until this is called, the opp_table structure * will not be freed. */ -void dev_pm_opp_put_prop_name(struct opp_table *opp_table) +static void _opp_put_prop_name(struct opp_table *opp_table) { - if (unlikely(!opp_table)) - return; - - kfree(opp_table->prop_name); - opp_table->prop_name = NULL; - - dev_pm_opp_put_opp_table(opp_table); + if (opp_table->prop_name) { + kfree(opp_table->prop_name); + opp_table->prop_name = NULL; + } } -EXPORT_SYMBOL_GPL(dev_pm_opp_put_prop_name); /** * _opp_set_regulators() - Set regulator names for the device @@ -2411,9 +2394,11 @@ struct opp_table *dev_pm_opp_set_config(struct device *dev, // Configure property names if (config->prop_name) { - ret = dev_pm_opp_set_prop_name(dev, config->prop_name); - if (IS_ERR(ret)) + err = _opp_set_prop_name(opp_table, config->prop_name); + if (err) { + ret = ERR_PTR(err); goto err; + } } // Configure opp helper @@ -2487,8 +2472,7 @@ void dev_pm_opp_clear_config(struct opp_table *opp_table) _opp_unregister_set_opp_helper(opp_table); - if (opp_table->prop_name) - dev_pm_opp_put_prop_name(opp_table); + _opp_put_prop_name(opp_table); _opp_put_clkname(opp_table); diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index a310564ab698..6cf1bbc71ed2 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -184,8 +184,6 @@ struct opp_table *dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_co int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config); void dev_pm_opp_clear_config(struct opp_table *opp_table); -struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name); -void dev_pm_opp_put_prop_name(struct opp_table *opp_table); struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table, struct opp_table *dst_table, struct dev_pm_opp *src_opp); int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate); int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq); @@ -357,13 +355,6 @@ static inline int dev_pm_opp_unregister_notifier(struct device *dev, struct noti return -EOPNOTSUPP; } -static inline struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name) -{ - return ERR_PTR(-EOPNOTSUPP); -} - -static inline void dev_pm_opp_put_prop_name(struct opp_table *opp_table) {} - static inline struct opp_table *dev_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config) { return ERR_PTR(-EOPNOTSUPP); -- 2.31.1.272.g89b43f80a514
| |