linux-mips
[Top] [All Lists]

Re: [PATCH 1/1] acer-wmi: switch driver to dev_pm_ops

To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] acer-wmi: switch driver to dev_pm_ops
From: Arnaud Faucher <arnaud.faucher@gmail.com>
Date: Sun, 26 Jul 2009 09:53:33 -0400
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, "Rafael J. Wysocki" <rjw@sisk.pl>, Frans Pop <elendil@planet.nl>, "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>, Manuel Lauss <manuel.lauss@gmail.com>, Erik Ekman <erik@kryo.se>, Mark Brown <broonie@opensource.wolfsonmicro.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=tt/+qbeytB3dsO/FxvvqT1ft/fHLi0KWhadSXXwyAcs=; b=cG/u6U1043Eb2FQIxPIkQuWum711OduFPORsaK6G9xS4LV9KHgM7gnEE2S8bVFd2nD ZZssrV0jaA9B4T5jHzbIKC9j9hyv5m2eUXFW6zZmPbCwQhG1PUqXUjWYp0P0Gt8m9YQs AsG+eu/EaMVZ9nUqUwwXq7MnU0CCyqoUCzsow=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=QznguFHZ34upXOAiAa0iF18umLrdE2dB+msoU19wDuHCVQ3EmB8U8K9MoySS5puhwb 8wYNiTMwV2D4xxuixr8B0b3jC2qhGOM4U1VOQoeuNHvT8W+e0OWMy3yLm2Stm5eSYuz/ 3HBFHlYZUzxmMJjuWpI+XhRS2EbCwLGjQRwSk=
In-reply-to: <200907252204.44875.rjw@sisk.pl>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1248527091-18246-1-git-send-email-arnaud.faucher@gmail.com> <20090725174311.GB14062@dtor-d630.eng.vmware.com> <200907252204.44875.rjw@sisk.pl>
Sender: linux-mips-bounce@linux-mips.org
Gets rid of the following warning:
Platform driver 'acer-wmi' needs updating - please use dev_pm_ops

Take 2, thanks to Dmitry, Rafael and Frans for pointing out PM issue on
hibernation when using dev_pm_ops blindly.

This patch was tested against suspendand hibernation (Acer mail led
status).

Signed-off-by: Arnaud Faucher <arnaud.faucher@gmail.com>
---
 drivers/platform/x86/acer-wmi.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c
b/drivers/platform/x86/acer-wmi.c
index be2fd6f..29374bc 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1152,8 +1152,7 @@ static int acer_platform_remove(struct
platform_device *device)
        return 0;
 }
 
-static int acer_platform_suspend(struct platform_device *dev,
-pm_message_t state)
+static int acer_platform_suspend(struct device *dev)
 {
        u32 value;
        struct acer_data *data = &interface->data;
@@ -1174,7 +1173,7 @@ pm_message_t state)
        return 0;
 }
 
-static int acer_platform_resume(struct platform_device *device)
+static int acer_platform_resume(struct device *dev)
 {
        struct acer_data *data = &interface->data;
 
@@ -1190,15 +1189,23 @@ static int acer_platform_resume(struct
platform_device *device)
        return 0;
 }
 
+static struct dev_pm_ops acer_platform_pm_ops = {
+       .suspend = acer_platform_suspend,
+       .resume = acer_platform_resume,
+       .freeze = acer_platform_suspend,
+       .thaw = acer_platform_resume,
+       .poweroff = acer_platform_suspend,
+       .restore = acer_platform_resume,
+};
+
 static struct platform_driver acer_platform_driver = {
        .driver = {
                .name = "acer-wmi",
                .owner = THIS_MODULE,
+               .pm = &acer_platform_pm_ops,
        },
        .probe = acer_platform_probe,
        .remove = acer_platform_remove,
-       .suspend = acer_platform_suspend,
-       .resume = acer_platform_resume,
 };
 
 static struct platform_device *acer_platform_device;
-- 
1.6.3.3



<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 1/1] acer-wmi: switch driver to dev_pm_ops, Arnaud Faucher <=