lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1248616413.3922.7.camel@green>
Date:	Sun, 26 Jul 2009 09:53:33 -0400
From:	Arnaud Faucher <arnaud.faucher@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Carlos Corbacho <carlos@...angeworlds.co.uk>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>, Frans Pop <elendil@...net.nl>,
	"linux-mips@...ux-mips.org" <linux-mips@...ux-mips.org>,
	Manuel Lauss <manuel.lauss@...il.com>,
	Erik Ekman <erik@...o.se>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: Re: [PATCH 1/1] acer-wmi: switch driver to dev_pm_ops

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@...il.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ