Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -7
+10 -7
drivers/input/keyboard/matrix_keypad.c
··· 213 213 } 214 214 215 215 #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) 217 217 { 218 + struct platform_device *pdev = to_platform_device(dev); 218 219 struct matrix_keypad *keypad = platform_get_drvdata(pdev); 219 220 const struct matrix_keypad_platform_data *pdata = keypad->pdata; 220 221 int i; ··· 229 228 return 0; 230 229 } 231 230 232 - static int matrix_keypad_resume(struct platform_device *pdev) 231 + static int matrix_keypad_resume(struct device *dev) 233 232 { 233 + struct platform_device *pdev = to_platform_device(dev); 234 234 struct matrix_keypad *keypad = platform_get_drvdata(pdev); 235 235 const struct matrix_keypad_platform_data *pdata = keypad->pdata; 236 236 int i; ··· 244 242 245 243 return 0; 246 244 } 247 - #else 248 - #define matrix_keypad_suspend NULL 249 - #define matrix_keypad_resume NULL 245 + 246 + static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops, 247 + matrix_keypad_suspend, matrix_keypad_resume); 250 248 #endif 251 249 252 250 static int __devinit init_matrix_gpio(struct platform_device *pdev, ··· 419 417 static struct platform_driver matrix_keypad_driver = { 420 418 .probe = matrix_keypad_probe, 421 419 .remove = __devexit_p(matrix_keypad_remove), 422 - .suspend = matrix_keypad_suspend, 423 - .resume = matrix_keypad_resume, 424 420 .driver = { 425 421 .name = "matrix-keypad", 426 422 .owner = THIS_MODULE, 423 + #ifdef CONFIG_PM 424 + .pm = &matrix_keypad_pm_ops, 425 + #endif 427 426 }, 428 427 }; 429 428