From 7e044e056a6aa0dc695db50461d7b326fde15e8b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sat, 9 May 2009 16:08:05 -0700 Subject: Input: serio - do not use deprecated dev.power.power_state Signed-off-by: Dmitry Torokhov --- drivers/input/serio/i8042.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'drivers/input/serio/i8042.c') diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 3cffb704e374..f919bf57293c 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -10,6 +10,7 @@ * the Free Software Foundation. */ +#include #include #include #include @@ -921,6 +922,9 @@ static void i8042_dritek_enable(void) #endif #ifdef CONFIG_PM + +static bool i8042_suspended; + /* * Here we try to restore the original BIOS settings. We only want to * do that once, when we really suspend, not when we taking memory @@ -930,11 +934,9 @@ static void i8042_dritek_enable(void) static int i8042_suspend(struct platform_device *dev, pm_message_t state) { - if (dev->dev.power.power_state.event != state.event) { - if (state.event == PM_EVENT_SUSPEND) - i8042_controller_reset(); - - dev->dev.power.power_state = state; + if (!i8042_suspended && state.event == PM_EVENT_SUSPEND) { + i8042_controller_reset(); + i8042_suspended = true; } return 0; @@ -952,7 +954,7 @@ static int i8042_resume(struct platform_device *dev) /* * Do not bother with restoring state if we haven't suspened yet */ - if (dev->dev.power.power_state.event == PM_EVENT_ON) + if (!i8042_suspended) return 0; error = i8042_controller_check(); @@ -998,10 +1000,9 @@ static int i8042_resume(struct platform_device *dev) if (i8042_ports[I8042_KBD_PORT_NO].serio) i8042_enable_kbd_port(); + i8042_suspended = false; i8042_interrupt(0, NULL); - dev->dev.power.power_state = PMSG_ON; - return 0; } #endif /* CONFIG_PM */ -- cgit v1.2.3-55-g7522