Skip to content

Commit 6544abc

Browse files
wlozano0collaboravireshk
authored andcommitted
opp: Increase parsed_static_opps in _of_add_opp_table_v1()
Currently, when using _of_add_opp_table_v2 parsed_static_opps is increased and this value is used in _opp_remove_all_static() to check if there are static opp entries that need to be freed. Unfortunately this does not happen when using _of_add_opp_table_v1(), which leads to warnings. This patch increases parsed_static_opps in _of_add_opp_table_v1() in a similar way as in _of_add_opp_table_v2(). Fixes: 03758d6 ("opp: Replace list_kref with a local counter") Cc: v5.6+ <[email protected]> # v5.6+ Signed-off-by: Walter Lozano <[email protected]> [ Viresh: Do the operation with lock held and set the value to 1 instead of incrementing it ] Signed-off-by: Viresh Kumar <[email protected]>
1 parent b3a9e3b commit 6544abc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/opp/of.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,10 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
902902
return -EINVAL;
903903
}
904904

905+
mutex_lock(&opp_table->lock);
906+
opp_table->parsed_static_opps = 1;
907+
mutex_unlock(&opp_table->lock);
908+
905909
val = prop->value;
906910
while (nr) {
907911
unsigned long freq = be32_to_cpup(val++) * 1000;

0 commit comments

Comments
 (0)