Commit cd1a068a authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

PM / OPP rename 'head' as 'rcu_head' or 'srcu_head' based on its type

Both 'struct dev_pm_opp' and 'struct device_opp' have member with name 'head'
but with different types. This leads to confusion while reading the code.

Name them 'rcu_head' and 'srcu_head'.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5d01410f
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
* @rate: Frequency in hertz * @rate: Frequency in hertz
* @u_volt: Nominal voltage in microvolts corresponding to this OPP * @u_volt: Nominal voltage in microvolts corresponding to this OPP
* @dev_opp: points back to the device_opp struct this opp belongs to * @dev_opp: points back to the device_opp struct this opp belongs to
* @head: RCU callback head used for deferred freeing * @rcu_head: RCU callback head used for deferred freeing
* *
* This structure stores the OPP information for a given device. * This structure stores the OPP information for a given device.
*/ */
...@@ -65,7 +65,7 @@ struct dev_pm_opp { ...@@ -65,7 +65,7 @@ struct dev_pm_opp {
unsigned long u_volt; unsigned long u_volt;
struct device_opp *dev_opp; struct device_opp *dev_opp;
struct rcu_head head; struct rcu_head rcu_head;
}; };
/** /**
...@@ -76,7 +76,7 @@ struct dev_pm_opp { ...@@ -76,7 +76,7 @@ struct dev_pm_opp {
* RCU usage: nodes are not modified in the list of device_opp, * RCU usage: nodes are not modified in the list of device_opp,
* however addition is possible and is secured by dev_opp_list_lock * however addition is possible and is secured by dev_opp_list_lock
* @dev: device pointer * @dev: device pointer
* @head: notifier head to notify the OPP availability changes. * @srcu_head: notifier head to notify the OPP availability changes.
* @opp_list: list of opps * @opp_list: list of opps
* *
* This is an internal data structure maintaining the link to opps attached to * This is an internal data structure maintaining the link to opps attached to
...@@ -87,7 +87,7 @@ struct device_opp { ...@@ -87,7 +87,7 @@ struct device_opp {
struct list_head node; struct list_head node;
struct device *dev; struct device *dev;
struct srcu_notifier_head head; struct srcu_notifier_head srcu_head;
struct list_head opp_list; struct list_head opp_list;
}; };
...@@ -436,7 +436,7 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) ...@@ -436,7 +436,7 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
} }
dev_opp->dev = dev; dev_opp->dev = dev;
srcu_init_notifier_head(&dev_opp->head); srcu_init_notifier_head(&dev_opp->srcu_head);
INIT_LIST_HEAD(&dev_opp->opp_list); INIT_LIST_HEAD(&dev_opp->opp_list);
/* Secure the device list modification */ /* Secure the device list modification */
...@@ -481,7 +481,7 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt) ...@@ -481,7 +481,7 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
* Notify the changes in the availability of the operable * Notify the changes in the availability of the operable
* frequency/voltage list. * frequency/voltage list.
*/ */
srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ADD, new_opp); srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ADD, new_opp);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(dev_pm_opp_add); EXPORT_SYMBOL_GPL(dev_pm_opp_add);
...@@ -557,14 +557,14 @@ static int opp_set_availability(struct device *dev, unsigned long freq, ...@@ -557,14 +557,14 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
list_replace_rcu(&opp->node, &new_opp->node); list_replace_rcu(&opp->node, &new_opp->node);
mutex_unlock(&dev_opp_list_lock); mutex_unlock(&dev_opp_list_lock);
kfree_rcu(opp, head); kfree_rcu(opp, rcu_head);
/* Notify the change of the OPP availability */ /* Notify the change of the OPP availability */
if (availability_req) if (availability_req)
srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ENABLE, srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ENABLE,
new_opp); new_opp);
else else
srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_DISABLE, srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_DISABLE,
new_opp); new_opp);
return 0; return 0;
...@@ -629,7 +629,7 @@ struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev) ...@@ -629,7 +629,7 @@ struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
if (IS_ERR(dev_opp)) if (IS_ERR(dev_opp))
return ERR_CAST(dev_opp); /* matching type */ return ERR_CAST(dev_opp); /* matching type */
return &dev_opp->head; return &dev_opp->srcu_head;
} }
#ifdef CONFIG_OF #ifdef CONFIG_OF
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment