* [PATCH] Input: matrix-keypad - switch to using dev_pm_ops
@ 2009-12-03 6:12 Dmitry Torokhov
2009-12-03 21:43 ` Rafael J. Wysocki
2009-12-03 21:43 ` Rafael J. Wysocki
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2009-12-03 6:12 UTC (permalink / raw)
To: Linux Input; +Cc: linux-pm, Rafael J. Wysocki
Input: matrix-keypad - switch to using dev_pm_ops
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/keyboard/matrix_keypad.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index a1152ba..d3c8b61 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -215,8 +215,9 @@ static void matrix_keypad_stop(struct input_dev *dev)
}
#ifdef CONFIG_PM
-static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state)
+static int matrix_keypad_suspend(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
int i;
@@ -237,8 +238,9 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
return 0;
}
-static int matrix_keypad_resume(struct platform_device *pdev)
+static int matrix_keypad_resume(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
int i;
@@ -257,9 +259,9 @@ static int matrix_keypad_resume(struct platform_device *pdev)
return 0;
}
-#else
-#define matrix_keypad_suspend NULL
-#define matrix_keypad_resume NULL
+
+static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
+ matrix_keypad_suspend, matrix_keypad_resume);
#endif
static int __devinit init_matrix_gpio(struct platform_device *pdev,
@@ -432,11 +434,12 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev)
static struct platform_driver matrix_keypad_driver = {
.probe = matrix_keypad_probe,
.remove = __devexit_p(matrix_keypad_remove),
- .suspend = matrix_keypad_suspend,
- .resume = matrix_keypad_resume,
.driver = {
.name = "matrix-keypad",
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &matrix_keypad_pm_ops,
+#endif
},
};
--
Dmitry
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: matrix-keypad - switch to using dev_pm_ops
2009-12-03 6:12 [PATCH] Input: matrix-keypad - switch to using dev_pm_ops Dmitry Torokhov
@ 2009-12-03 21:43 ` Rafael J. Wysocki
2009-12-03 21:43 ` Rafael J. Wysocki
1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2009-12-03 21:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Linux Input, linux-pm
On Thursday 03 December 2009, Dmitry Torokhov wrote:
> Input: matrix-keypad - switch to using dev_pm_ops
>
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Looks good.
Thanks,
Rafael
> ---
>
> drivers/input/keyboard/matrix_keypad.c | 17 ++++++++++-------
> 1 files changed, 10 insertions(+), 7 deletions(-)
>
>
> diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
> index a1152ba..d3c8b61 100644
> --- a/drivers/input/keyboard/matrix_keypad.c
> +++ b/drivers/input/keyboard/matrix_keypad.c
> @@ -215,8 +215,9 @@ static void matrix_keypad_stop(struct input_dev *dev)
> }
>
> #ifdef CONFIG_PM
> -static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state)
> +static int matrix_keypad_suspend(struct device *dev)
> {
> + struct platform_device *pdev = to_platform_device(dev);
> struct matrix_keypad *keypad = platform_get_drvdata(pdev);
> const struct matrix_keypad_platform_data *pdata = keypad->pdata;
> int i;
> @@ -237,8 +238,9 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
> return 0;
> }
>
> -static int matrix_keypad_resume(struct platform_device *pdev)
> +static int matrix_keypad_resume(struct device *dev)
> {
> + struct platform_device *pdev = to_platform_device(dev);
> struct matrix_keypad *keypad = platform_get_drvdata(pdev);
> const struct matrix_keypad_platform_data *pdata = keypad->pdata;
> int i;
> @@ -257,9 +259,9 @@ static int matrix_keypad_resume(struct platform_device *pdev)
>
> return 0;
> }
> -#else
> -#define matrix_keypad_suspend NULL
> -#define matrix_keypad_resume NULL
> +
> +static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
> + matrix_keypad_suspend, matrix_keypad_resume);
> #endif
>
> static int __devinit init_matrix_gpio(struct platform_device *pdev,
> @@ -432,11 +434,12 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev)
> static struct platform_driver matrix_keypad_driver = {
> .probe = matrix_keypad_probe,
> .remove = __devexit_p(matrix_keypad_remove),
> - .suspend = matrix_keypad_suspend,
> - .resume = matrix_keypad_resume,
> .driver = {
> .name = "matrix-keypad",
> .owner = THIS_MODULE,
> +#ifdef CONFIG_PM
> + .pm = &matrix_keypad_pm_ops,
> +#endif
> },
> };
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Input: matrix-keypad - switch to using dev_pm_ops
2009-12-03 6:12 [PATCH] Input: matrix-keypad - switch to using dev_pm_ops Dmitry Torokhov
2009-12-03 21:43 ` Rafael J. Wysocki
@ 2009-12-03 21:43 ` Rafael J. Wysocki
1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2009-12-03 21:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-pm, Linux Input
On Thursday 03 December 2009, Dmitry Torokhov wrote:
> Input: matrix-keypad - switch to using dev_pm_ops
>
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Looks good.
Thanks,
Rafael
> ---
>
> drivers/input/keyboard/matrix_keypad.c | 17 ++++++++++-------
> 1 files changed, 10 insertions(+), 7 deletions(-)
>
>
> diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
> index a1152ba..d3c8b61 100644
> --- a/drivers/input/keyboard/matrix_keypad.c
> +++ b/drivers/input/keyboard/matrix_keypad.c
> @@ -215,8 +215,9 @@ static void matrix_keypad_stop(struct input_dev *dev)
> }
>
> #ifdef CONFIG_PM
> -static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state)
> +static int matrix_keypad_suspend(struct device *dev)
> {
> + struct platform_device *pdev = to_platform_device(dev);
> struct matrix_keypad *keypad = platform_get_drvdata(pdev);
> const struct matrix_keypad_platform_data *pdata = keypad->pdata;
> int i;
> @@ -237,8 +238,9 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
> return 0;
> }
>
> -static int matrix_keypad_resume(struct platform_device *pdev)
> +static int matrix_keypad_resume(struct device *dev)
> {
> + struct platform_device *pdev = to_platform_device(dev);
> struct matrix_keypad *keypad = platform_get_drvdata(pdev);
> const struct matrix_keypad_platform_data *pdata = keypad->pdata;
> int i;
> @@ -257,9 +259,9 @@ static int matrix_keypad_resume(struct platform_device *pdev)
>
> return 0;
> }
> -#else
> -#define matrix_keypad_suspend NULL
> -#define matrix_keypad_resume NULL
> +
> +static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
> + matrix_keypad_suspend, matrix_keypad_resume);
> #endif
>
> static int __devinit init_matrix_gpio(struct platform_device *pdev,
> @@ -432,11 +434,12 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev)
> static struct platform_driver matrix_keypad_driver = {
> .probe = matrix_keypad_probe,
> .remove = __devexit_p(matrix_keypad_remove),
> - .suspend = matrix_keypad_suspend,
> - .resume = matrix_keypad_resume,
> .driver = {
> .name = "matrix-keypad",
> .owner = THIS_MODULE,
> +#ifdef CONFIG_PM
> + .pm = &matrix_keypad_pm_ops,
> +#endif
> },
> };
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Input: matrix-keypad - switch to using dev_pm_ops
@ 2009-12-03 6:12 Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2009-12-03 6:12 UTC (permalink / raw)
To: Linux Input; +Cc: linux-pm
Input: matrix-keypad - switch to using dev_pm_ops
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/keyboard/matrix_keypad.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index a1152ba..d3c8b61 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -215,8 +215,9 @@ static void matrix_keypad_stop(struct input_dev *dev)
}
#ifdef CONFIG_PM
-static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state)
+static int matrix_keypad_suspend(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
int i;
@@ -237,8 +238,9 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat
return 0;
}
-static int matrix_keypad_resume(struct platform_device *pdev)
+static int matrix_keypad_resume(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct matrix_keypad *keypad = platform_get_drvdata(pdev);
const struct matrix_keypad_platform_data *pdata = keypad->pdata;
int i;
@@ -257,9 +259,9 @@ static int matrix_keypad_resume(struct platform_device *pdev)
return 0;
}
-#else
-#define matrix_keypad_suspend NULL
-#define matrix_keypad_resume NULL
+
+static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops,
+ matrix_keypad_suspend, matrix_keypad_resume);
#endif
static int __devinit init_matrix_gpio(struct platform_device *pdev,
@@ -432,11 +434,12 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev)
static struct platform_driver matrix_keypad_driver = {
.probe = matrix_keypad_probe,
.remove = __devexit_p(matrix_keypad_remove),
- .suspend = matrix_keypad_suspend,
- .resume = matrix_keypad_resume,
.driver = {
.name = "matrix-keypad",
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &matrix_keypad_pm_ops,
+#endif
},
};
--
Dmitry
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-03 21:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-03 6:12 [PATCH] Input: matrix-keypad - switch to using dev_pm_ops Dmitry Torokhov
2009-12-03 21:43 ` Rafael J. Wysocki
2009-12-03 21:43 ` Rafael J. Wysocki
2009-12-03 6:12 Dmitry Torokhov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.