aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-06-22 19:52:55 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-07-02 08:29:54 -0400
commit564b905ab10d17fb42f86aa8b7b9b796276d1336 (patch)
treeb191c000e55ae1a354bd67876ca6945d2ad87c93 /drivers/base/power
parentf5da24dbed213d103f00aa9ef26e010b50d2db24 (diff)
PM / Domains: Rename struct dev_power_domain to struct dev_pm_domain
The naming convention used by commit 7538e3db6e015e890825fbd9f86599b (PM: Add support for device power domains), which introduced the struct dev_power_domain type for representing device power domains, evidently confuses some developers who tend to think that objects of this type must correspond to "power domains" as defined by hardware, which is not the case. Namely, at the kernel level, a struct dev_power_domain object can represent arbitrary set of devices that are mutually dependent power management-wise and need not belong to one hardware power domain. To avoid that confusion, rename struct dev_power_domain to struct dev_pm_domain and rename the related pointers in struct device and struct pm_clk_notifier_block from pwr_domain to pm_domain. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/base/power')
-rw-r--r--drivers/base/power/clock_ops.c14
-rw-r--r--drivers/base/power/main.c30
-rw-r--r--drivers/base/power/runtime.c12
3 files changed, 28 insertions, 28 deletions
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index ad367c4139b1..c5624818259e 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -278,11 +278,11 @@ int pm_runtime_clk_resume(struct device *dev)
278 * 278 *
279 * For this function to work, @nb must be a member of an object of type 279 * For this function to work, @nb must be a member of an object of type
280 * struct pm_clk_notifier_block containing all of the requisite data. 280 * struct pm_clk_notifier_block containing all of the requisite data.
281 * Specifically, the pwr_domain member of that object is copied to the device's 281 * Specifically, the pm_domain member of that object is copied to the device's
282 * pwr_domain field and its con_ids member is used to populate the device's list 282 * pm_domain field and its con_ids member is used to populate the device's list
283 * of runtime PM clocks, depending on @action. 283 * of runtime PM clocks, depending on @action.
284 * 284 *
285 * If the device's pwr_domain field is already populated with a value different 285 * If the device's pm_domain field is already populated with a value different
286 * from the one stored in the struct pm_clk_notifier_block object, the function 286 * from the one stored in the struct pm_clk_notifier_block object, the function
287 * does nothing. 287 * does nothing.
288 */ 288 */
@@ -300,14 +300,14 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
300 300
301 switch (action) { 301 switch (action) {
302 case BUS_NOTIFY_ADD_DEVICE: 302 case BUS_NOTIFY_ADD_DEVICE:
303 if (dev->pwr_domain) 303 if (dev->pm_domain)
304 break; 304 break;
305 305
306 error = pm_runtime_clk_init(dev); 306 error = pm_runtime_clk_init(dev);
307 if (error) 307 if (error)
308 break; 308 break;
309 309
310 dev->pwr_domain = clknb->pwr_domain; 310 dev->pm_domain = clknb->pm_domain;
311 if (clknb->con_ids[0]) { 311 if (clknb->con_ids[0]) {
312 for (con_id = clknb->con_ids; *con_id; con_id++) 312 for (con_id = clknb->con_ids; *con_id; con_id++)
313 pm_runtime_clk_add(dev, *con_id); 313 pm_runtime_clk_add(dev, *con_id);
@@ -317,10 +317,10 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
317 317
318 break; 318 break;
319 case BUS_NOTIFY_DEL_DEVICE: 319 case BUS_NOTIFY_DEL_DEVICE:
320 if (dev->pwr_domain != clknb->pwr_domain) 320 if (dev->pm_domain != clknb->pm_domain)
321 break; 321 break;
322 322
323 dev->pwr_domain = NULL; 323 dev->pm_domain = NULL;
324 pm_runtime_clk_destroy(dev); 324 pm_runtime_clk_destroy(dev);
325 break; 325 break;
326 } 326 }
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 06f09bf89cb2..85b591a5429a 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -425,9 +425,9 @@ static int device_resume_noirq(struct device *dev, pm_message_t state)
425 TRACE_DEVICE(dev); 425 TRACE_DEVICE(dev);
426 TRACE_RESUME(0); 426 TRACE_RESUME(0);
427 427
428 if (dev->pwr_domain) { 428 if (dev->pm_domain) {
429 pm_dev_dbg(dev, state, "EARLY power domain "); 429 pm_dev_dbg(dev, state, "EARLY power domain ");
430 error = pm_noirq_op(dev, &dev->pwr_domain->ops, state); 430 error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
431 } else if (dev->type && dev->type->pm) { 431 } else if (dev->type && dev->type->pm) {
432 pm_dev_dbg(dev, state, "EARLY type "); 432 pm_dev_dbg(dev, state, "EARLY type ");
433 error = pm_noirq_op(dev, dev->type->pm, state); 433 error = pm_noirq_op(dev, dev->type->pm, state);
@@ -521,9 +521,9 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
521 if (!dev->power.is_suspended) 521 if (!dev->power.is_suspended)
522 goto Unlock; 522 goto Unlock;
523 523
524 if (dev->pwr_domain) { 524 if (dev->pm_domain) {
525 pm_dev_dbg(dev, state, "power domain "); 525 pm_dev_dbg(dev, state, "power domain ");
526 error = pm_op(dev, &dev->pwr_domain->ops, state); 526 error = pm_op(dev, &dev->pm_domain->ops, state);
527 goto End; 527 goto End;
528 } 528 }
529 529
@@ -641,10 +641,10 @@ static void device_complete(struct device *dev, pm_message_t state)
641{ 641{
642 device_lock(dev); 642 device_lock(dev);
643 643
644 if (dev->pwr_domain) { 644 if (dev->pm_domain) {
645 pm_dev_dbg(dev, state, "completing power domain "); 645 pm_dev_dbg(dev, state, "completing power domain ");
646 if (dev->pwr_domain->ops.complete) 646 if (dev->pm_domain->ops.complete)
647 dev->pwr_domain->ops.complete(dev); 647 dev->pm_domain->ops.complete(dev);
648 } else if (dev->type && dev->type->pm) { 648 } else if (dev->type && dev->type->pm) {
649 pm_dev_dbg(dev, state, "completing type "); 649 pm_dev_dbg(dev, state, "completing type ");
650 if (dev->type->pm->complete) 650 if (dev->type->pm->complete)
@@ -744,9 +744,9 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state)
744{ 744{
745 int error; 745 int error;
746 746
747 if (dev->pwr_domain) { 747 if (dev->pm_domain) {
748 pm_dev_dbg(dev, state, "LATE power domain "); 748 pm_dev_dbg(dev, state, "LATE power domain ");
749 error = pm_noirq_op(dev, &dev->pwr_domain->ops, state); 749 error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
750 if (error) 750 if (error)
751 return error; 751 return error;
752 } else if (dev->type && dev->type->pm) { 752 } else if (dev->type && dev->type->pm) {
@@ -853,9 +853,9 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
853 goto Unlock; 853 goto Unlock;
854 } 854 }
855 855
856 if (dev->pwr_domain) { 856 if (dev->pm_domain) {
857 pm_dev_dbg(dev, state, "power domain "); 857 pm_dev_dbg(dev, state, "power domain ");
858 error = pm_op(dev, &dev->pwr_domain->ops, state); 858 error = pm_op(dev, &dev->pm_domain->ops, state);
859 goto End; 859 goto End;
860 } 860 }
861 861
@@ -982,11 +982,11 @@ static int device_prepare(struct device *dev, pm_message_t state)
982 982
983 device_lock(dev); 983 device_lock(dev);
984 984
985 if (dev->pwr_domain) { 985 if (dev->pm_domain) {
986 pm_dev_dbg(dev, state, "preparing power domain "); 986 pm_dev_dbg(dev, state, "preparing power domain ");
987 if (dev->pwr_domain->ops.prepare) 987 if (dev->pm_domain->ops.prepare)
988 error = dev->pwr_domain->ops.prepare(dev); 988 error = dev->pm_domain->ops.prepare(dev);
989 suspend_report_result(dev->pwr_domain->ops.prepare, error); 989 suspend_report_result(dev->pm_domain->ops.prepare, error);
990 if (error) 990 if (error)
991 goto End; 991 goto End;
992 } else if (dev->type && dev->type->pm) { 992 } else if (dev->type && dev->type->pm) {
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 0d4587b15c55..5f5c4236f006 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -213,8 +213,8 @@ static int rpm_idle(struct device *dev, int rpmflags)
213 213
214 dev->power.idle_notification = true; 214 dev->power.idle_notification = true;
215 215
216 if (dev->pwr_domain) 216 if (dev->pm_domain)
217 callback = dev->pwr_domain->ops.runtime_idle; 217 callback = dev->pm_domain->ops.runtime_idle;
218 else if (dev->type && dev->type->pm) 218 else if (dev->type && dev->type->pm)
219 callback = dev->type->pm->runtime_idle; 219 callback = dev->type->pm->runtime_idle;
220 else if (dev->class && dev->class->pm) 220 else if (dev->class && dev->class->pm)
@@ -374,8 +374,8 @@ static int rpm_suspend(struct device *dev, int rpmflags)
374 374
375 __update_runtime_status(dev, RPM_SUSPENDING); 375 __update_runtime_status(dev, RPM_SUSPENDING);
376 376
377 if (dev->pwr_domain) 377 if (dev->pm_domain)
378 callback = dev->pwr_domain->ops.runtime_suspend; 378 callback = dev->pm_domain->ops.runtime_suspend;
379 else if (dev->type && dev->type->pm) 379 else if (dev->type && dev->type->pm)
380 callback = dev->type->pm->runtime_suspend; 380 callback = dev->type->pm->runtime_suspend;
381 else if (dev->class && dev->class->pm) 381 else if (dev->class && dev->class->pm)
@@ -573,8 +573,8 @@ static int rpm_resume(struct device *dev, int rpmflags)
573 573
574 __update_runtime_status(dev, RPM_RESUMING); 574 __update_runtime_status(dev, RPM_RESUMING);
575 575
576 if (dev->pwr_domain) 576 if (dev->pm_domain)
577 callback = dev->pwr_domain->ops.runtime_resume; 577 callback = dev->pm_domain->ops.runtime_resume;
578 else if (dev->type && dev->type->pm) 578 else if (dev->type && dev->type->pm)
579 callback = dev->type->pm->runtime_resume; 579 callback = dev->type->pm->runtime_resume;
580 else if (dev->class && dev->class->pm) 580 else if (dev->class && dev->class->pm)