diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2022-05-26 09:36:27 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2022-06-24 06:22:28 +0530 |
commit | b5b75437a2d05addf41539b62c0275259f1b986c (patch) | |
tree | ecaca5efdab4c4aaf1b012ef3baec2ae2c06a0e1 /drivers/opp/core.c | |
parent | a455fd4c2bfde78f2e255429f87619890228803b (diff) | |
download | linux-next-b5b75437a2d05addf41539b62c0275259f1b986c.tar.gz |
OPP: Remove dev_pm_opp_set_prop_name() and friends
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>
Diffstat (limited to 'drivers/opp/core.c')
-rw-r--r-- | drivers/opp/core.c | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 906ac3125330..9620e7b3992d 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 @@ -2417,9 +2400,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 */ @@ -2497,8 +2482,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_clknames(opp_table); |