Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328732
b: refs/heads/master
c: ed95347
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Lezcano authored and Rafael J. Wysocki committed Sep 21, 2012
1 parent 3d96f57 commit 855b869
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a77de28662adea391d8ed952e2b9c49b60193e8c
refs/heads/master: ed953472d181e1d149f17d85d82de9634db296c3
15 changes: 9 additions & 6 deletions trunk/drivers/cpuidle/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ static struct cpuidle_driver *cpuidle_curr_driver;
DEFINE_SPINLOCK(cpuidle_driver_lock);
int cpuidle_driver_refcount;

static void __cpuidle_register_driver(struct cpuidle_driver *drv)
static void set_power_states(struct cpuidle_driver *drv)
{
int i;

/*
* cpuidle driver should set the drv->power_specified bit
* before registering if the driver provides
Expand All @@ -35,10 +36,8 @@ static void __cpuidle_register_driver(struct cpuidle_driver *drv)
* an power value of -1. So we use -2, -3, etc, for other
* c-states.
*/
if (!drv->power_specified) {
for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++)
drv->states[i].power_usage = -1 - i;
}
for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++)
drv->states[i].power_usage = -1 - i;
}

/**
Expand All @@ -58,8 +57,12 @@ int cpuidle_register_driver(struct cpuidle_driver *drv)
spin_unlock(&cpuidle_driver_lock);
return -EBUSY;
}
__cpuidle_register_driver(drv);

if (!drv->power_specified)
set_power_states(drv);

cpuidle_curr_driver = drv;

spin_unlock(&cpuidle_driver_lock);

return 0;
Expand Down

0 comments on commit 855b869

Please sign in to comment.