PM / OPP: Error out on failing to add static OPPs for v1 bindings
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 2 Jan 2017 09:10:58 +0000 (14:40 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Jan 2017 10:49:09 +0000 (11:49 +0100)
The code adding static OPPs for V2 bindings already does so. Make the V1
bindings specific code behave the same.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp/of.c

index f8512ca2bf41495004ef3f5f1c25599e04a33cf1..c8fe815774ff8886e8fd03201a9c02edd454e954 100644 (file)
@@ -433,7 +433,7 @@ static int _of_add_opp_table_v1(struct device *dev)
 {
        const struct property *prop;
        const __be32 *val;
-       int nr;
+       int nr, ret;
 
        prop = of_find_property(dev->of_node, "operating-points", NULL);
        if (!prop)
@@ -456,9 +456,13 @@ static int _of_add_opp_table_v1(struct device *dev)
                unsigned long freq = be32_to_cpup(val++) * 1000;
                unsigned long volt = be32_to_cpup(val++);
 
-               if (_opp_add_v1(dev, freq, volt, false))
-                       dev_warn(dev, "%s: Failed to add OPP %ld\n",
-                                __func__, freq);
+               ret = _opp_add_v1(dev, freq, volt, false);
+               if (ret) {
+                       dev_err(dev, "%s: Failed to add OPP %ld (%d)\n",
+                               __func__, freq, ret);
+                       dev_pm_opp_of_remove_table(dev);
+                       return ret;
+               }
                nr -= 2;
        }