Merge branch 'pm-opp'
[linux-2.6-microblaze.git] / drivers / opp / of.c
index d298e38..2a97c65 100644 (file)
@@ -95,15 +95,7 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table,
 static struct device_node *of_parse_required_opp(struct device_node *np,
                                                 int index)
 {
-       struct device_node *required_np;
-
-       required_np = of_parse_phandle(np, "required-opps", index);
-       if (unlikely(!required_np)) {
-               pr_err("%s: Unable to parse required-opps: %pOF, index: %d\n",
-                      __func__, np, index);
-       }
-
-       return required_np;
+       return of_parse_phandle(np, "required-opps", index);
 }
 
 /* The caller must call dev_pm_opp_put_opp_table() after the table is used */
@@ -964,8 +956,9 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
                }
        }
 
-       /* There should be one of more OPP defined */
-       if (WARN_ON(!count)) {
+       /* There should be one or more OPPs defined */
+       if (!count) {
+               dev_err(dev, "%s: no supported OPPs", __func__);
                ret = -ENOENT;
                goto remove_static_opp;
        }
@@ -1327,7 +1320,7 @@ int of_get_required_opp_performance_state(struct device_node *np, int index)
 
        required_np = of_parse_required_opp(np, index);
        if (!required_np)
-               return -EINVAL;
+               return -ENODEV;
 
        opp_table = _find_table_of_opp_np(required_np);
        if (IS_ERR(opp_table)) {