Skip to content

Commit f72a28a

Browse files
committed
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>
1 parent 4678320 commit f72a28a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

drivers/input/keyboard/matrix_keypad.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ static void matrix_keypad_stop(struct input_dev *dev)
213213
}
214214

215215
#ifdef CONFIG_PM
216-
static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state)
216+
static int matrix_keypad_suspend(struct device *dev)
217217
{
218+
struct platform_device *pdev = to_platform_device(dev);
218219
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
219220
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
220221
int i;
@@ -228,8 +229,9 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
228229
return 0;
229230
}
230231

231-
static int matrix_keypad_resume(struct platform_device *pdev)
232+
static int matrix_keypad_resume(struct device *dev)
232233
{
234+
struct platform_device *pdev = to_platform_device(dev);
233235
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
234236
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
235237
int i;
@@ -242,9 +244,9 @@ static int matrix_keypad_resume(struct platform_device *pdev)
242244

243245
return 0;
244246
}
245-
#else
246-
#define matrix_keypad_suspend NULL
247-
#define matrix_keypad_resume NULL
247+
248+
static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
249+
matrix_keypad_suspend, matrix_keypad_resume);
248250
#endif
249251

250252
static int __devinit init_matrix_gpio(struct platform_device *pdev,
@@ -417,11 +419,12 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev)
417419
static struct platform_driver matrix_keypad_driver = {
418420
.probe = matrix_keypad_probe,
419421
.remove = __devexit_p(matrix_keypad_remove),
420-
.suspend = matrix_keypad_suspend,
421-
.resume = matrix_keypad_resume,
422422
.driver = {
423423
.name = "matrix-keypad",
424424
.owner = THIS_MODULE,
425+
#ifdef CONFIG_PM
426+
.pm = &matrix_keypad_pm_ops,
427+
#endif
425428
},
426429
};
427430

0 commit comments

Comments
 (0)