* [PATCH] Input: gpio_keys - swtich to dev_pm_ops
@ 2009-07-21 13:59 Mike Rapoport
2009-07-21 15:48 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2009-07-21 13:59 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, Mike Rapoport
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
drivers/input/keyboard/gpio_keys.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index efed0c9..a3a3b98 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -215,9 +215,9 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
}
-#ifdef CONFIG_PM
-static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state)
+static int gpio_keys_suspend(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
int i;
@@ -234,8 +234,9 @@ static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
-static int gpio_keys_resume(struct platform_device *pdev)
+static int gpio_keys_resume(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
int i;
@@ -251,19 +252,19 @@ static int gpio_keys_resume(struct platform_device *pdev)
return 0;
}
-#else
-#define gpio_keys_suspend NULL
-#define gpio_keys_resume NULL
-#endif
+
+static struct dev_pm_ops gpio_keys_pm_ops = {
+ .suspend = gpio_keys_suspend,
+ .resume = gpio_keys_resume,
+};
static struct platform_driver gpio_keys_device_driver = {
.probe = gpio_keys_probe,
- .remove = __devexit_p(gpio_keys_remove),
- .suspend = gpio_keys_suspend,
.resume = gpio_keys_resume,
.driver = {
.name = "gpio-keys",
.owner = THIS_MODULE,
+ .pm = &gpio_keys_pm_ops,
}
};
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio_keys - swtich to dev_pm_ops
2009-07-21 13:59 [PATCH] Input: gpio_keys - swtich to dev_pm_ops Mike Rapoport
@ 2009-07-21 15:48 ` Dmitry Torokhov
2009-07-21 15:58 ` Mike Rapoport
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2009-07-21 15:48 UTC (permalink / raw)
To: Mike Rapoport; +Cc: linux-input
Hi Mike,
On Tue, Jul 21, 2009 at 04:59:10PM +0300, Mike Rapoport wrote:
> +
> +static struct dev_pm_ops gpio_keys_pm_ops = {
> + .suspend = gpio_keys_suspend,
> + .resume = gpio_keys_resume,
> +};
>
This is not 100% equivalent conversion since we are now only handling
s2r, not s2d.. My question though is whether we care or not...
> static struct platform_driver gpio_keys_device_driver = {
> .probe = gpio_keys_probe,
> - .remove = __devexit_p(gpio_keys_remove),
> - .suspend = gpio_keys_suspend,
> .resume = gpio_keys_resume,
> .driver = {
> .name = "gpio-keys",
> .owner = THIS_MODULE,
> + .pm = &gpio_keys_pm_ops,
> }
> };
>
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio_keys - swtich to dev_pm_ops
2009-07-21 15:48 ` Dmitry Torokhov
@ 2009-07-21 15:58 ` Mike Rapoport
2009-07-22 16:41 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Mike Rapoport @ 2009-07-21 15:58 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
Dmitry Torokhov wrote:
> Hi Mike,
>
> On Tue, Jul 21, 2009 at 04:59:10PM +0300, Mike Rapoport wrote:
>> +
>> +static struct dev_pm_ops gpio_keys_pm_ops = {
>> + .suspend = gpio_keys_suspend,
>> + .resume = gpio_keys_resume,
>> +};
>>
>
> This is not 100% equivalent conversion since we are now only handling
> s2r, not s2d.. My question though is whether we care or not...
I doubt that systems that use gpio-keys ever supported s2d...
If you apply it we'll know soon :)
>> static struct platform_driver gpio_keys_device_driver = {
>> .probe = gpio_keys_probe,
>> - .remove = __devexit_p(gpio_keys_remove),
>> - .suspend = gpio_keys_suspend,
>> .resume = gpio_keys_resume,
>> .driver = {
>> .name = "gpio-keys",
>> .owner = THIS_MODULE,
>> + .pm = &gpio_keys_pm_ops,
>> }
>> };
>>
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio_keys - swtich to dev_pm_ops
2009-07-21 15:58 ` Mike Rapoport
@ 2009-07-22 16:41 ` Dmitry Torokhov
2009-07-26 5:57 ` Mike Rapoport
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2009-07-22 16:41 UTC (permalink / raw)
To: Mike Rapoport; +Cc: linux-input
On Tue, Jul 21, 2009 at 06:58:03PM +0300, Mike Rapoport wrote:
>
>
> Dmitry Torokhov wrote:
> > Hi Mike,
> >
> > On Tue, Jul 21, 2009 at 04:59:10PM +0300, Mike Rapoport wrote:
> >> +
> >> +static struct dev_pm_ops gpio_keys_pm_ops = {
> >> + .suspend = gpio_keys_suspend,
> >> + .resume = gpio_keys_resume,
> >> +};
> >>
> >
> > This is not 100% equivalent conversion since we are now only handling
> > s2r, not s2d.. My question though is whether we care or not...
>
> I doubt that systems that use gpio-keys ever supported s2d...
> If you apply it we'll know soon :)
>
> >> static struct platform_driver gpio_keys_device_driver = {
> >> .probe = gpio_keys_probe,
> >> - .remove = __devexit_p(gpio_keys_remove),
> >> - .suspend = gpio_keys_suspend,
> >> .resume = gpio_keys_resume,
I don't think you tried compiling this patch ;( We still need the
remove() method and I think we should keep the CONFIG_PM guards.
I will fix locally.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio_keys - swtich to dev_pm_ops
2009-07-22 16:41 ` Dmitry Torokhov
@ 2009-07-26 5:57 ` Mike Rapoport
0 siblings, 0 replies; 5+ messages in thread
From: Mike Rapoport @ 2009-07-26 5:57 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
Dmitry Torokhov wrote:
> On Tue, Jul 21, 2009 at 06:58:03PM +0300, Mike Rapoport wrote:
>>
>> Dmitry Torokhov wrote:
>>> Hi Mike,
>>>
>>> On Tue, Jul 21, 2009 at 04:59:10PM +0300, Mike Rapoport wrote:
>>>> +
>>>> +static struct dev_pm_ops gpio_keys_pm_ops = {
>>>> + .suspend = gpio_keys_suspend,
>>>> + .resume = gpio_keys_resume,
>>>> +};
>>>>
>>> This is not 100% equivalent conversion since we are now only handling
>>> s2r, not s2d.. My question though is whether we care or not...
>> I doubt that systems that use gpio-keys ever supported s2d...
>> If you apply it we'll know soon :)
>>
>>>> static struct platform_driver gpio_keys_device_driver = {
>>>> .probe = gpio_keys_probe,
>>>> - .remove = __devexit_p(gpio_keys_remove),
>>>> - .suspend = gpio_keys_suspend,
>>>> .resume = gpio_keys_resume,
>
> I don't think you tried compiling this patch ;( We still need the
> remove() method and I think we should keep the CONFIG_PM guards.
I did, just I have the gpio-keys built-in in my config, so .remove is not called ...
> I will fix locally.
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-07-26 5:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 13:59 [PATCH] Input: gpio_keys - swtich to dev_pm_ops Mike Rapoport
2009-07-21 15:48 ` Dmitry Torokhov
2009-07-21 15:58 ` Mike Rapoport
2009-07-22 16:41 ` Dmitry Torokhov
2009-07-26 5:57 ` Mike Rapoport
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).