Commit 4cb1383f authored by Viresh Kumar's avatar Viresh Kumar
Browse files

OPP: Remove _get_opp_table_kref()



Use dev_pm_opp_get_opp_table_ref() directly instead.

No intentional functional impact.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 0af2f6be
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ static struct opp_table *_find_opp_table_unlocked(struct device *dev)

	list_for_each_entry(opp_table, &opp_tables, node) {
		if (_find_opp_dev(dev, opp_table)) {
			_get_opp_table_kref(opp_table);
			dev_pm_opp_get_opp_table_ref(opp_table);
			return opp_table;
		}
	}
@@ -1688,14 +1688,9 @@ static void _opp_table_kref_release(struct kref *kref)
	kfree(opp_table);
}

void _get_opp_table_kref(struct opp_table *opp_table)
{
	kref_get(&opp_table->kref);
}

void dev_pm_opp_get_opp_table_ref(struct opp_table *opp_table)
{
	_get_opp_table_kref(opp_table);
	kref_get(&opp_table->kref);
}
EXPORT_SYMBOL_GPL(dev_pm_opp_get_opp_table_ref);

+3 −3
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ struct opp_table *_managed_opp(struct device *dev, int index)
			 * OPP table contains a "opp-shared" property.
			 */
			if (opp_table->shared_opp == OPP_TABLE_ACCESS_SHARED) {
				_get_opp_table_kref(opp_table);
				dev_pm_opp_get_opp_table_ref(opp_table);
				managed_table = opp_table;
			}

@@ -117,7 +117,7 @@ static struct opp_table *_find_table_of_opp_np(struct device_node *opp_np)
	mutex_lock(&opp_table_lock);
	list_for_each_entry(opp_table, &opp_tables, node) {
		if (opp_table_np == opp_table->np) {
			_get_opp_table_kref(opp_table);
			dev_pm_opp_get_opp_table_ref(opp_table);
			mutex_unlock(&opp_table_lock);
			return opp_table;
		}
@@ -406,7 +406,7 @@ static void lazy_link_required_opp_table(struct opp_table *new_table)
			}

			required_opp_tables[i] = new_table;
			_get_opp_table_kref(new_table);
			dev_pm_opp_get_opp_table_ref(new_table);

			/* Link OPPs now */
			ret = lazy_link_required_opps(opp_table, new_table, i);
+0 −1
Original line number Diff line number Diff line
@@ -251,7 +251,6 @@ struct opp_table {

/* Routines internal to opp core */
bool _opp_remove_all_static(struct opp_table *opp_table);
void _get_opp_table_kref(struct opp_table *opp_table);
int _get_opp_count(struct opp_table *opp_table);
struct opp_table *_find_opp_table(struct device *dev);
struct opp_device *_add_opp_dev(const struct device *dev, struct opp_table *opp_table);