aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2009-07-23 02:02:54 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-07-25 01:12:15 -0400
commitae78e0e0e49885bef3bffee2a56254db6abf562c (patch)
treefd782e96f0182357282b9276a8352423c4b5788a /drivers/input/keyboard
parent8150f32b90f630ad3e460f026ce338cb81685bc9 (diff)
Input: gpio_keys - swtich to dev_pm_ops
Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/gpio_keys.c19
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
219static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state) 219static 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
237static int gpio_keys_resume(struct platform_device *pdev) 238static 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 257static 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
259static struct platform_driver gpio_keys_device_driver = { 263static 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