X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fbase%2Fpower%2Fruntime.c;h=325962d8019153d28316399ab7b5a8da3887293e;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=d901a6fd6dc46698247748de52fa09a50a1844c6;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index d901a6fd6..325962d80 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -12,9 +12,11 @@ static void runtime_resume(struct device * dev) { + dev_dbg(dev, "resuming\n"); if (!dev->power.power_state) return; - resume_device(dev); + if (!resume_device(dev)) + dev->power.power_state = 0; } @@ -22,9 +24,9 @@ static void runtime_resume(struct device * dev) * dpm_runtime_resume - Power one device back on. * @dev: Device. * - * Bring one device back to the on state by first powering it + * Bring one device back to the on state by first powering it * on, then restoring state. We only operate on devices that aren't - * already on. + * already on. * FIXME: We need to handle devices that are in an unknown state. */ @@ -42,7 +44,7 @@ void dpm_runtime_resume(struct device * dev) * @state: State to enter. */ -int dpm_runtime_suspend(struct device * dev, u32 state) +int dpm_runtime_suspend(struct device * dev, pm_message_t state) { int error = 0; @@ -53,7 +55,7 @@ int dpm_runtime_suspend(struct device * dev, u32 state) if (dev->power.power_state) runtime_resume(dev); - if (!(error = suspend_device(dev,state))) + if (!(error = suspend_device(dev, state))) dev->power.power_state = state; Done: up(&dpm_sem); @@ -68,10 +70,10 @@ int dpm_runtime_suspend(struct device * dev, u32 state) * * This is an update mechanism for drivers to notify the core * what power state a device is in. Device probing code may not - * always be able to tell, but we need accurate information to + * always be able to tell, but we need accurate information to * work reliably. */ -void dpm_set_power_state(struct device * dev, u32 state) +void dpm_set_power_state(struct device * dev, pm_message_t state) { down(&dpm_sem); dev->power.power_state = state;