diff options
Diffstat (limited to 'drivers/input/keyboard/gpio_keys.c')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index efed0c9e242e..a88aff3816a0 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -216,8 +216,9 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev) | |||
216 | 216 | ||
217 | 217 | ||
218 | #ifdef CONFIG_PM | 218 | #ifdef CONFIG_PM |
219 | static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state) | 219 | static int gpio_keys_suspend(struct device *dev) |
220 | { | 220 | { |
221 | struct platform_device *pdev = to_platform_device(dev); | ||
221 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | 222 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; |
222 | int i; | 223 | int i; |
223 | 224 | ||
@@ -234,8 +235,9 @@ static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state) | |||
234 | return 0; | 235 | return 0; |
235 | } | 236 | } |
236 | 237 | ||
237 | static int gpio_keys_resume(struct platform_device *pdev) | 238 | static int gpio_keys_resume(struct device *dev) |
238 | { | 239 | { |
240 | struct platform_device *pdev = to_platform_device(dev); | ||
239 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | 241 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; |
240 | int i; | 242 | int i; |
241 | 243 | ||
@@ -251,19 +253,22 @@ static int gpio_keys_resume(struct platform_device *pdev) | |||
251 | 253 | ||
252 | return 0; | 254 | return 0; |
253 | } | 255 | } |
254 | #else | 256 | |
255 | #define gpio_keys_suspend NULL | 257 | static const struct dev_pm_ops gpio_keys_pm_ops = { |
256 | #define gpio_keys_resume NULL | 258 | .suspend = gpio_keys_suspend, |
259 | .resume = gpio_keys_resume, | ||
260 | }; | ||
257 | #endif | 261 | #endif |
258 | 262 | ||
259 | static struct platform_driver gpio_keys_device_driver = { | 263 | static struct platform_driver gpio_keys_device_driver = { |
260 | .probe = gpio_keys_probe, | 264 | .probe = gpio_keys_probe, |
261 | .remove = __devexit_p(gpio_keys_remove), | 265 | .remove = __devexit_p(gpio_keys_remove), |
262 | .suspend = gpio_keys_suspend, | ||
263 | .resume = gpio_keys_resume, | ||
264 | .driver = { | 266 | .driver = { |
265 | .name = "gpio-keys", | 267 | .name = "gpio-keys", |
266 | .owner = THIS_MODULE, | 268 | .owner = THIS_MODULE, |
269 | #ifdef CONFIG_PM | ||
270 | .pm = &gpio_keys_pm_ops, | ||
271 | #endif | ||
267 | } | 272 | } |
268 | }; | 273 | }; |
269 | 274 | ||