@@ -1317,19 +1317,23 @@ static int _of_init_opp_table_v2(struct device *dev,
/* We have opp-list node now, iterate over it and add OPPs */
for_each_available_child_of_node(opp_np, np) {
- count++;
-
ret = _opp_add_static_v2(dev, np);
if (ret) {
dev_err(dev, "%s: Failed to add OPP, %d\n", __func__,
ret);
break;
}
+ count++;
}
/* There should be one of more OPP defined */
- if (WARN_ON(!count))
+ if (WARN_ON(!count)) {
+ ret = -ENOENT;
goto put_opp_np;
+ }
+ if (ret)
+ goto free_table;
regards,
dan carpenter