aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-11-25 05:34:16 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-11-29 17:53:20 -0500
commitcd1a068a52ee6a3331a62fe53e87d6ca6cfd68a5 (patch)
treee98ed5da190763fc727e236706a8e534c63ca4e1 /drivers/base
parent5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff)
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: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/opp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 89ced955fafa..76ae6fd28345 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -53,7 +53,7 @@
53 * @rate: Frequency in hertz 53 * @rate: Frequency in hertz
54 * @u_volt: Nominal voltage in microvolts corresponding to this OPP 54 * @u_volt: Nominal voltage in microvolts corresponding to this OPP
55 * @dev_opp: points back to the device_opp struct this opp belongs to 55 * @dev_opp: points back to the device_opp struct this opp belongs to
56 * @head: RCU callback head used for deferred freeing 56 * @rcu_head: RCU callback head used for deferred freeing
57 * 57 *
58 * This structure stores the OPP information for a given device. 58 * This structure stores the OPP information for a given device.
59 */ 59 */
@@ -65,7 +65,7 @@ struct dev_pm_opp {
65 unsigned long u_volt; 65 unsigned long u_volt;
66 66
67 struct device_opp *dev_opp; 67 struct device_opp *dev_opp;
68 struct rcu_head head; 68 struct rcu_head rcu_head;
69}; 69};
70 70
71/** 71/**
@@ -76,7 +76,7 @@ struct dev_pm_opp {
76 * RCU usage: nodes are not modified in the list of device_opp, 76 * RCU usage: nodes are not modified in the list of device_opp,
77 * however addition is possible and is secured by dev_opp_list_lock 77 * however addition is possible and is secured by dev_opp_list_lock
78 * @dev: device pointer 78 * @dev: device pointer
79 * @head: notifier head to notify the OPP availability changes. 79 * @srcu_head: notifier head to notify the OPP availability changes.
80 * @opp_list: list of opps 80 * @opp_list: list of opps
81 * 81 *
82 * This is an internal data structure maintaining the link to opps attached to 82 * This is an internal data structure maintaining the link to opps attached to
@@ -87,7 +87,7 @@ struct device_opp {
87 struct list_head node; 87 struct list_head node;
88 88
89 struct device *dev; 89 struct device *dev;
90 struct srcu_notifier_head head; 90 struct srcu_notifier_head srcu_head;
91 struct list_head opp_list; 91 struct list_head opp_list;
92}; 92};
93 93
@@ -436,7 +436,7 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
436 } 436 }
437 437
438 dev_opp->dev = dev; 438 dev_opp->dev = dev;
439 srcu_init_notifier_head(&dev_opp->head); 439 srcu_init_notifier_head(&dev_opp->srcu_head);
440 INIT_LIST_HEAD(&dev_opp->opp_list); 440 INIT_LIST_HEAD(&dev_opp->opp_list);
441 441
442 /* Secure the device list modification */ 442 /* 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 * Notify the changes in the availability of the operable 481 * Notify the changes in the availability of the operable
482 * frequency/voltage list. 482 * frequency/voltage list.
483 */ 483 */
484 srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ADD, new_opp); 484 srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ADD, new_opp);
485 return 0; 485 return 0;
486} 486}
487EXPORT_SYMBOL_GPL(dev_pm_opp_add); 487EXPORT_SYMBOL_GPL(dev_pm_opp_add);
@@ -557,14 +557,14 @@ static int opp_set_availability(struct device *dev, unsigned long freq,
557 557
558 list_replace_rcu(&opp->node, &new_opp->node); 558 list_replace_rcu(&opp->node, &new_opp->node);
559 mutex_unlock(&dev_opp_list_lock); 559 mutex_unlock(&dev_opp_list_lock);
560 kfree_rcu(opp, head); 560 kfree_rcu(opp, rcu_head);
561 561
562 /* Notify the change of the OPP availability */ 562 /* Notify the change of the OPP availability */
563 if (availability_req) 563 if (availability_req)
564 srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_ENABLE, 564 srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_ENABLE,
565 new_opp); 565 new_opp);
566 else 566 else
567 srcu_notifier_call_chain(&dev_opp->head, OPP_EVENT_DISABLE, 567 srcu_notifier_call_chain(&dev_opp->srcu_head, OPP_EVENT_DISABLE,
568 new_opp); 568 new_opp);
569 569
570 return 0; 570 return 0;
@@ -629,7 +629,7 @@ struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
629 if (IS_ERR(dev_opp)) 629 if (IS_ERR(dev_opp))
630 return ERR_CAST(dev_opp); /* matching type */ 630 return ERR_CAST(dev_opp); /* matching type */
631 631
632 return &dev_opp->head; 632 return &dev_opp->srcu_head;
633} 633}
634 634
635#ifdef CONFIG_OF 635#ifdef CONFIG_OF