OPP: Fix parsing of multiple phandles in "operating-points-v2" property
[linux-2.6-block.git] / drivers / opp / of.c
index 5a4b47958073ee4526772f35e8b5614cc3c63418..38a08805a30c64bba10519550474cac0fc83cdad 100644 (file)
@@ -579,10 +579,8 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
                 */
                count = of_count_phandle_with_args(dev->of_node,
                                                   "operating-points-v2", NULL);
-               if (count != 1)
-                       return -ENODEV;
-
-               index = 0;
+               if (count == 1)
+                       index = 0;
        }
 
        opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);