aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-04 01:24:15 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-04 01:26:03 -0500
commitf72a28aba92d5a599c8a772e443aa8f079b3091f (patch)
tree6bf48d24091a149f84e085462bd6295af4a3bb11 /drivers/input/keyboard
parent467832032cc07626880363efa8625719c16c04eb (diff)
Input: matrix-keypad - switch to using dev_pm_ops
Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/matrix_keypad.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 91cfe5170265..34f4a29d4973 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -213,8 +213,9 @@ static void matrix_keypad_stop(struct input_dev *dev)
213} 213}
214 214
215#ifdef CONFIG_PM 215#ifdef CONFIG_PM
216static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state) 216static int matrix_keypad_suspend(struct device *dev)
217{ 217{
218 struct platform_device *pdev = to_platform_device(dev);
218 struct matrix_keypad *keypad = platform_get_drvdata(pdev); 219 struct matrix_keypad *keypad = platform_get_drvdata(pdev);
219 const struct matrix_keypad_platform_data *pdata = keypad->pdata; 220 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
220 int i; 221 int i;
@@ -228,8 +229,9 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
228 return 0; 229 return 0;
229} 230}
230 231
231static int matrix_keypad_resume(struct platform_device *pdev) 232static int matrix_keypad_resume(struct device *dev)
232{ 233{
234 struct platform_device *pdev = to_platform_device(dev);
233 struct matrix_keypad *keypad = platform_get_drvdata(pdev); 235 struct matrix_keypad *keypad = platform_get_drvdata(pdev);
234 const struct matrix_keypad_platform_data *pdata = keypad->pdata; 236 const struct matrix_keypad_platform_data *pdata = keypad->pdata;
235 int i; 237 int i;
@@ -242,9 +244,9 @@ static int matrix_keypad_resume(struct platform_device *pdev)
242 244
243 return 0; 245 return 0;
244} 246}
245#else 247
246#define matrix_keypad_suspend NULL 248static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
247#define matrix_keypad_resume NULL 249 matrix_keypad_suspend, matrix_keypad_resume);
248#endif 250#endif
249 251
250static int __devinit init_matrix_gpio(struct platform_device *pdev, 252static int __devinit init_matrix_gpio(struct platform_device *pdev,
@@ -417,11 +419,12 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev)
417static struct platform_driver matrix_keypad_driver = { 419static struct platform_driver matrix_keypad_driver = {
418 .probe = matrix_keypad_probe, 420 .probe = matrix_keypad_probe,
419 .remove = __devexit_p(matrix_keypad_remove), 421 .remove = __devexit_p(matrix_keypad_remove),
420 .suspend = matrix_keypad_suspend,
421 .resume = matrix_keypad_resume,
422 .driver = { 422 .driver = {
423 .name = "matrix-keypad", 423 .name = "matrix-keypad",
424 .owner = THIS_MODULE, 424 .owner = THIS_MODULE,
425#ifdef CONFIG_PM
426 .pm = &matrix_keypad_pm_ops,
427#endif
425 }, 428 },
426}; 429};
427 430