PM / devfreq: Change prototype of devfreq_get_devfreq_by_phandle function
[platform/kernel/linux-rpi.git] / drivers / devfreq / devfreq.c
index d4424b5..861c100 100644 (file)
@@ -1012,22 +1012,24 @@ struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
 /*
  * devfreq_get_devfreq_by_phandle - Get the devfreq device from devicetree
  * @dev - instance to the given device
+ * @phandle_name - name of property holding a phandle value
  * @index - index into list of devfreq
  *
  * return the instance of devfreq device
  */
-struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index)
+struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
+                                       const char *phandle_name, int index)
 {
        struct device_node *node;
        struct devfreq *devfreq;
 
-       if (!dev)
+       if (!dev || !phandle_name)
                return ERR_PTR(-EINVAL);
 
        if (!dev->of_node)
                return ERR_PTR(-EINVAL);
 
-       node = of_parse_phandle(dev->of_node, "devfreq", index);
+       node = of_parse_phandle(dev->of_node, phandle_name, index);
        if (!node)
                return ERR_PTR(-ENODEV);
 
@@ -1043,7 +1045,8 @@ struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
        return ERR_PTR(-ENODEV);
 }
 
-struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index)
+struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
+                                       const char *phandle_name, int index)
 {
        return ERR_PTR(-ENODEV);
 }