Skip to contentSkip to conversation

Input: ep93xx_keypad - switch to using dev_pm_ops

PATCH In review Dmitry Torokhov 2 participants 2 messages Apr 10, 2012

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: ep93xx_keypad - switch to using dev_pm_ops

---
 drivers/input/keyboard/ep93xx_keypad.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
drivers/input/keyboard/ep93xx_keypad.c +10 -10
index 0ba69f3..d6cd634 100644
@@ -182,16 +182,16 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
 }
 
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 /*
  * NOTE: I don't know if this is correct, or will work on the ep93xx.
  *
  * None of the existing ep93xx drivers have power management support.
  * But, this is basically what the pxa27x_keypad driver does.
  */
-static int ep93xx_keypad_suspend(struct platform_device *pdev,
-				 pm_message_t state)
+static int ep93xx_keypad_suspend(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
 	struct input_dev *input_dev = keypad->input_dev;
 
@@ -210,8 +210,9 @@ static int ep93xx_keypad_suspend(struct platform_device *pdev,
 	return 0;
 }
 
-static int ep93xx_keypad_resume(struct platform_device *pdev)
+static int ep93xx_keypad_resume(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
 	struct input_dev *input_dev = keypad->input_dev;
 
@@ -232,10 +233,10 @@ static int ep93xx_keypad_resume(struct platform_device *pdev)
 
 	return 0;
 }
-#else	/* !CONFIG_PM */
-#define ep93xx_keypad_suspend	NULL
-#define ep93xx_keypad_resume	NULL
-#endif	/* !CONFIG_PM */
+#endif
+
+static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
+			 ep93xx_keypad_suspend, ep93xx_keypad_resume);
 
 static int __devinit ep93xx_keypad_probe(struct platform_device *pdev)
 {
@@ -384,11 +385,10 @@ static struct platform_driver ep93xx_keypad_driver = {
 	.driver		= {
 		.name	= "ep93xx-keypad",
 		.owner	= THIS_MODULE,
+		.pm	= &ep93xx_keypad_pm_ops,
 	},
 	.probe		= ep93xx_keypad_probe,
 	.remove		= __devexit_p(ep93xx_keypad_remove),
-	.suspend	= ep93xx_keypad_suspend,
-	.resume		= ep93xx_keypad_resume,
 };
 module_platform_driver(ep93xx_keypad_driver);
 
Signature · 5 lines
1.7.7.6


-- 
Dmitry
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Dmitry Torokhov
---
 drivers/input/keyboard/ep93xx_keypad.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
drivers/input/keyboard/ep93xx_keypad.c +0 -0
index 0ba69f3..d6cd634 100644
@@ -182,16 +182,16 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
 }

drivers/input/keyboard/ep93xx_keypad.c static void ep93xx_keypad_close(struct input_dev *pdev) · line 191

Quoted 10 lines
drivers/input/keyboard/ep93xx_keypad.c +1 -1
 
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 /*
  * NOTE: I don't know if this is correct, or will work on the ep93xx.
  *
  * None of the existing ep93xx drivers have power management support.
  * But, this is basically what the pxa27x_keypad driver does.
  */

Dmitry,

The comment above can probably be removed also.

Quoted 36 lines
drivers/input/keyboard/ep93xx_keypad.c +8 -7
-static int ep93xx_keypad_suspend(struct platform_device *pdev,
-				 pm_message_t state)
+static int ep93xx_keypad_suspend(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
 	struct input_dev *input_dev = keypad->input_dev;
 
@@ -210,8 +210,9 @@ static int ep93xx_keypad_suspend(struct platform_device *pdev,
 	return 0;
 }
 
-static int ep93xx_keypad_resume(struct platform_device *pdev)
+static int ep93xx_keypad_resume(struct device *dev)
 {
+	struct platform_device *pdev = to_platform_device(dev);
 	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
 	struct input_dev *input_dev = keypad->input_dev;
 
@@ -232,10 +233,10 @@ static int ep93xx_keypad_resume(struct platform_device *pdev)
 
 	return 0;
 }
-#else	/* !CONFIG_PM */
-#define ep93xx_keypad_suspend	NULL
-#define ep93xx_keypad_resume	NULL
-#endif	/* !CONFIG_PM */
+#endif
+
+static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops,
+			 ep93xx_keypad_suspend, ep93xx_keypad_resume);
 
 static int __devinit ep93xx_keypad_probe(struct platform_device *pdev)
 {
@@ -384,11 +385,10 @@ static struct platform_driver ep93xx_keypad_driver = {
 	.driver		= {

drivers/input/keyboard/ep93xx_keypad.c static struct platform_driver ep93xx_keypad_driver = { · line 393

Quoted 10 lines
drivers/input/keyboard/ep93xx_keypad.c +1 -2
 		.name	= "ep93xx-keypad",
 		.owner	= THIS_MODULE,
+		.pm	= &ep93xx_keypad_pm_ops,
 	},
 	.probe		= ep93xx_keypad_probe,
 	.remove		= __devexit_p(ep93xx_keypad_remove),
-	.suspend	= ep93xx_keypad_suspend,
-	.resume		= ep93xx_keypad_resume,
 };
 module_platform_driver(ep93xx_keypad_driver);