linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method
@ 2012-01-11  7:35 Dmitry Torokhov
  2012-01-11  7:35 ` [PATCH 2/2] Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS Dmitry Torokhov
  2012-01-11  9:24 ` [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2012-01-11  7:35 UTC (permalink / raw)
  To: Sundar Iyer; +Cc: linux-input, Linus Walleij

Because we are using platform_device_probe() to register the driver
we do not need to assign driver's probe method. We also can mark
ske_keypad_probe(), together with ske_keypad_chip_init(), as __init
instead of __devinit.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/keyboard/nomadik-ske-keypad.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index e35566a..bc9f339 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -88,7 +88,7 @@ static void ske_keypad_set_bits(struct ske_keypad *keypad, u16 addr,
  *
  * Enable Multi key press detection, auto scan mode
  */
-static int __devinit ske_keypad_chip_init(struct ske_keypad *keypad)
+static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
 {
 	u32 value;
 	int timeout = 50;
@@ -198,7 +198,7 @@ static irqreturn_t ske_keypad_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit ske_keypad_probe(struct platform_device *pdev)
+static int __init ske_keypad_probe(struct platform_device *pdev)
 {
 	const struct ske_keypad_platform_data *plat = pdev->dev.platform_data;
 	struct ske_keypad *keypad;
@@ -387,7 +387,6 @@ static struct platform_driver ske_keypad_driver = {
 		.pm = &ske_keypad_dev_pm_ops,
 #endif
 	},
-	.probe = ske_keypad_probe,
 	.remove = __devexit_p(ske_keypad_remove),
 };
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS
  2012-01-11  7:35 [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method Dmitry Torokhov
@ 2012-01-11  7:35 ` Dmitry Torokhov
  2012-01-11  9:25   ` Linus Walleij
  2012-01-11  9:24 ` [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2012-01-11  7:35 UTC (permalink / raw)
  To: Sundar Iyer; +Cc: linux-input, Linus Walleij

Also proper guard for system suspend/resume methods is CONFIG_PM_SLEEP,
not CONFIG_PM.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/keyboard/nomadik-ske-keypad.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index bc9f339..101e245 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -344,7 +344,7 @@ static int __devexit ske_keypad_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int ske_keypad_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -372,20 +372,16 @@ static int ske_keypad_resume(struct device *dev)
 
 	return 0;
 }
-
-static const struct dev_pm_ops ske_keypad_dev_pm_ops = {
-	.suspend = ske_keypad_suspend,
-	.resume = ske_keypad_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops,
+			 ske_keypad_suspend, ske_keypad_resume);
+
 static struct platform_driver ske_keypad_driver = {
 	.driver = {
 		.name = "nmk-ske-keypad",
 		.owner  = THIS_MODULE,
-#ifdef CONFIG_PM
 		.pm = &ske_keypad_dev_pm_ops,
-#endif
 	},
 	.remove = __devexit_p(ske_keypad_remove),
 };


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method
  2012-01-11  7:35 [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method Dmitry Torokhov
  2012-01-11  7:35 ` [PATCH 2/2] Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS Dmitry Torokhov
@ 2012-01-11  9:24 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-01-11  9:24 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Linux Input

On Wed, Jan 11, 2012 at 8:35 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> Because we are using platform_device_probe() to register the driver
> we do not need to assign driver's probe method. We also can mark
> ske_keypad_probe(), together with ske_keypad_chip_init(), as __init
> instead of __devinit.
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks Dmitry!
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS
  2012-01-11  7:35 ` [PATCH 2/2] Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS Dmitry Torokhov
@ 2012-01-11  9:25   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-01-11  9:25 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Sundar Iyer, linux-input

On Wed, Jan 11, 2012 at 8:35 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> Also proper guard for system suspend/resume methods is CONFIG_PM_SLEEP,
> not CONFIG_PM.
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-11  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11  7:35 [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method Dmitry Torokhov
2012-01-11  7:35 ` [PATCH 2/2] Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS Dmitry Torokhov
2012-01-11  9:25   ` Linus Walleij
2012-01-11  9:24 ` [PATCH 1/2] Input: nomadik-ske-keypad - do not assign driver's probe() method Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).