Skip to content

Commit e121ed7

Browse files
committed
Merge tag 'opp-updates-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
Pull OPP updates for 7.0 from Viresh Kumar: "- Return correct value in dev_pm_opp_get_level (Aleks Todorov). - Use scoped for each OF child loop (Krzysztof Kozlowski)." * tag 'opp-updates-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: OPP: Return correct value in dev_pm_opp_get_level OPP: of: Simplify with scoped for each OF child loop
2 parents 63804fe + 0b7277e commit e121ed7

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/opp/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp)
241241
{
242242
if (IS_ERR_OR_NULL(opp) || !opp->available) {
243243
pr_err("%s: Invalid parameters\n", __func__);
244-
return 0;
244+
return U32_MAX;
245245
}
246246

247247
return opp->level;

drivers/opp/of.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,6 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
956956
/* Initializes OPP tables based on new bindings */
957957
static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
958958
{
959-
struct device_node *np;
960959
int ret, count = 0;
961960
struct dev_pm_opp *opp;
962961

@@ -971,13 +970,12 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
971970
}
972971

973972
/* We have opp-table node now, iterate over it and add OPPs */
974-
for_each_available_child_of_node(opp_table->np, np) {
973+
for_each_available_child_of_node_scoped(opp_table->np, np) {
975974
opp = _opp_add_static_v2(opp_table, dev, np);
976975
if (IS_ERR(opp)) {
977976
ret = PTR_ERR(opp);
978977
dev_err(dev, "%s: Failed to add OPP, %d\n", __func__,
979978
ret);
980-
of_node_put(np);
981979
goto remove_static_opp;
982980
} else if (opp) {
983981
count++;

0 commit comments

Comments
 (0)