diff options
| -rw-r--r-- | drivers/cpuidle/cpuidle.c | 2 | ||||
| -rw-r--r-- | drivers/cpuidle/driver.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 77304b6b8aef..f7cab5e9c4d6 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
| @@ -268,7 +268,7 @@ int cpuidle_enable_device(struct cpuidle_device *dev) | |||
| 268 | if (!drv || !cpuidle_curr_governor) | 268 | if (!drv || !cpuidle_curr_governor) |
| 269 | return -EIO; | 269 | return -EIO; |
| 270 | if (!dev->state_count) | 270 | if (!dev->state_count) |
| 271 | return -EINVAL; | 271 | dev->state_count = drv->state_count; |
| 272 | 272 | ||
| 273 | if (dev->registered == 0) { | 273 | if (dev->registered == 0) { |
| 274 | ret = __cpuidle_register_device(dev); | 274 | ret = __cpuidle_register_device(dev); |
diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c index 284d7af5a9c8..40cd3f3024df 100644 --- a/drivers/cpuidle/driver.c +++ b/drivers/cpuidle/driver.c | |||
| @@ -47,7 +47,7 @@ static void __cpuidle_register_driver(struct cpuidle_driver *drv) | |||
| 47 | */ | 47 | */ |
| 48 | int cpuidle_register_driver(struct cpuidle_driver *drv) | 48 | int cpuidle_register_driver(struct cpuidle_driver *drv) |
| 49 | { | 49 | { |
| 50 | if (!drv) | 50 | if (!drv || !drv->state_count) |
| 51 | return -EINVAL; | 51 | return -EINVAL; |
| 52 | 52 | ||
| 53 | if (cpuidle_disabled()) | 53 | if (cpuidle_disabled()) |
