diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-04-11 03:13:50 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-04-11 03:14:16 -0400 |
commit | b5e9528bd19c6a3379aac468186f41d2bda48b04 (patch) | |
tree | cfa21adb31d9cc7cc707a0a938bcb8454b33dd4c /drivers/input | |
parent | d568778298f58330bcc8cc23845676d1143c8d33 (diff) |
Input: ep93xx_keypad - switch to using dev_pm_ops
Also use CONFIG_PM_SLEEP instead of CONFIG_PM to guard PM methods.
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/ep93xx_keypad.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 0ba69f3fcb52..df194bdaab50 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c | |||
@@ -182,16 +182,10 @@ static void ep93xx_keypad_close(struct input_dev *pdev) | |||
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | #ifdef CONFIG_PM | 185 | #ifdef CONFIG_PM_SLEEP |
186 | /* | 186 | static int ep93xx_keypad_suspend(struct device *dev) |
187 | * NOTE: I don't know if this is correct, or will work on the ep93xx. | ||
188 | * | ||
189 | * None of the existing ep93xx drivers have power management support. | ||
190 | * But, this is basically what the pxa27x_keypad driver does. | ||
191 | */ | ||
192 | static int ep93xx_keypad_suspend(struct platform_device *pdev, | ||
193 | pm_message_t state) | ||
194 | { | 187 | { |
188 | struct platform_device *pdev = to_platform_device(dev); | ||
195 | struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); | 189 | struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); |
196 | struct input_dev *input_dev = keypad->input_dev; | 190 | struct input_dev *input_dev = keypad->input_dev; |
197 | 191 | ||
@@ -210,8 +204,9 @@ static int ep93xx_keypad_suspend(struct platform_device *pdev, | |||
210 | return 0; | 204 | return 0; |
211 | } | 205 | } |
212 | 206 | ||
213 | static int ep93xx_keypad_resume(struct platform_device *pdev) | 207 | static int ep93xx_keypad_resume(struct device *dev) |
214 | { | 208 | { |
209 | struct platform_device *pdev = to_platform_device(dev); | ||
215 | struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); | 210 | struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); |
216 | struct input_dev *input_dev = keypad->input_dev; | 211 | struct input_dev *input_dev = keypad->input_dev; |
217 | 212 | ||
@@ -232,10 +227,10 @@ static int ep93xx_keypad_resume(struct platform_device *pdev) | |||
232 | 227 | ||
233 | return 0; | 228 | return 0; |
234 | } | 229 | } |
235 | #else /* !CONFIG_PM */ | 230 | #endif |
236 | #define ep93xx_keypad_suspend NULL | 231 | |
237 | #define ep93xx_keypad_resume NULL | 232 | static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops, |
238 | #endif /* !CONFIG_PM */ | 233 | ep93xx_keypad_suspend, ep93xx_keypad_resume); |
239 | 234 | ||
240 | static int __devinit ep93xx_keypad_probe(struct platform_device *pdev) | 235 | static int __devinit ep93xx_keypad_probe(struct platform_device *pdev) |
241 | { | 236 | { |
@@ -384,11 +379,10 @@ static struct platform_driver ep93xx_keypad_driver = { | |||
384 | .driver = { | 379 | .driver = { |
385 | .name = "ep93xx-keypad", | 380 | .name = "ep93xx-keypad", |
386 | .owner = THIS_MODULE, | 381 | .owner = THIS_MODULE, |
382 | .pm = &ep93xx_keypad_pm_ops, | ||
387 | }, | 383 | }, |
388 | .probe = ep93xx_keypad_probe, | 384 | .probe = ep93xx_keypad_probe, |
389 | .remove = __devexit_p(ep93xx_keypad_remove), | 385 | .remove = __devexit_p(ep93xx_keypad_remove), |
390 | .suspend = ep93xx_keypad_suspend, | ||
391 | .resume = ep93xx_keypad_resume, | ||
392 | }; | 386 | }; |
393 | module_platform_driver(ep93xx_keypad_driver); | 387 | module_platform_driver(ep93xx_keypad_driver); |
394 | 388 | ||