@@ -1269,14 +1269,14 @@ static int _of_init_opp_table_v2(struct device *dev,
{
struct device_node *np;
struct device_opp *dev_opp;
- int ret = 0, count = 0;
+ int ret, count = 0;
dev_opp = _managed_opp(opp_np);
if (dev_opp) {
/* OPPs are already managed */
if (!_add_list_dev(dev, dev_opp))
- ret = -ENOMEM;
- goto out;
+ return -ENOMEM;
+ return 0;
}
/* We have opp-list node now, iterate over it and add OPPs */
@@ -1287,31 +1287,24 @@ static int _of_init_opp_table_v2(struct device *dev,
if (ret) {
dev_err(dev, "%s: Failed to add OPP, %d\n", __func__,
ret);
- break;
+ of_free_opp_table(dev);
+ return ret;
}
}
/* There should be one of more OPP defined */
if (WARN_ON(!count))
- goto out;
-
- if (ret) {
- of_free_opp_table(dev);
- goto out;
- }
+ return -ENOENT;
dev_opp = _find_device_opp(dev);
- if (WARN_ON(!dev_opp)) {
- ret = -EINVAL;
- goto out;
- }
+ if (WARN_ON(!dev_opp))
+ return -EINVAL;
dev_opp->np = opp_np;
dev_opp->shared_opp = of_property_read_bool(opp_np,
"opp-shared");
-out:
- return ret;
+ return 0;
}
/* Initializes OPP tables based on old-deprecated bindings */