diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-22 21:51:36 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-26 11:17:01 -0700 |
commit | 633aae23ff31bef692a70772652e753a0ae59b81 (patch) | |
tree | c749165062fefa2cc6a5d5bdba0400ed290fa26f /drivers/input | |
parent | ebd7768daeb39b0691e25175e25b980f13e913e2 (diff) | |
download | op-kernel-dev-633aae23ff31bef692a70772652e753a0ae59b81.zip op-kernel-dev-633aae23ff31bef692a70772652e753a0ae59b81.tar.gz |
Input: serio - switch to using dev_pm_ops
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/serio/serio.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index d66f494..0236f0d 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -931,15 +931,11 @@ static int serio_uevent(struct device *dev, struct kobj_uevent_env *env) #endif /* CONFIG_HOTPLUG */ #ifdef CONFIG_PM -static int serio_suspend(struct device *dev, pm_message_t state) +static int serio_suspend(struct device *dev) { struct serio *serio = to_serio_port(dev); - if (!serio->suspended && state.event == PM_EVENT_SUSPEND) - serio_cleanup(serio); - - serio->suspended = state.event == PM_EVENT_SUSPEND || - state.event == PM_EVENT_FREEZE; + serio_cleanup(serio); return 0; } @@ -952,13 +948,17 @@ static int serio_resume(struct device *dev) * Driver reconnect can take a while, so better let kseriod * deal with it. */ - if (serio->suspended) { - serio->suspended = false; - serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT); - } + serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT); return 0; } + +static const struct dev_pm_ops serio_pm_ops = { + .suspend = serio_suspend, + .resume = serio_resume, + .poweroff = serio_suspend, + .restore = serio_resume, +}; #endif /* CONFIG_PM */ /* called from serio_driver->connect/disconnect methods under serio_mutex */ @@ -1015,8 +1015,7 @@ static struct bus_type serio_bus = { .remove = serio_driver_remove, .shutdown = serio_shutdown, #ifdef CONFIG_PM - .suspend = serio_suspend, - .resume = serio_resume, + .pm = &serio_pm_ops, #endif }; |