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]
Date:	Mon, 10 Feb 2014 09:12:30 -0700
From:	Shuah Khan <shuah.kh@...sung.com>
To:	rjw@...ysocki.net, gregkh@...uxfoundation.org
Cc:	Shuah Khan <shuah.kh@...sung.com>, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, shuahkhan@...il.com
Subject: [RFT][PATCH 07/12] isa: change isa bus power management to use dev_pm_ops

Change isa bus driver to register pm ops using dev_pm_ops instead of
legacy pm_ops. .pm hooks call existing legacy suspend and resume
interfaces by passing in the right pm state.

Signed-off-by: Shuah Khan <shuah.kh@...sung.com>
---
 drivers/base/isa.c |   30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/drivers/base/isa.c b/drivers/base/isa.c
index 91dba65..15b8825 100644
--- a/drivers/base/isa.c
+++ b/drivers/base/isa.c
@@ -63,7 +63,7 @@ static void isa_bus_shutdown(struct device *dev)
 		isa_driver->shutdown(dev, to_isa_dev(dev)->id);
 }
 
-static int isa_bus_suspend(struct device *dev, pm_message_t state)
+static int __isa_bus_suspend(struct device *dev, pm_message_t state)
 {
 	struct isa_driver *isa_driver = dev->platform_data;
 
@@ -73,6 +73,21 @@ static int isa_bus_suspend(struct device *dev, pm_message_t state)
 	return 0;
 }
 
+static int isa_bus_suspend(struct device *dev)
+{
+	return __isa_bus_suspend(dev, PMSG_SUSPEND);
+}
+
+static int isa_bus_freeze(struct device *dev)
+{
+	return __isa_bus_suspend(dev, PMSG_FREEZE);
+}
+
+static int isa_bus_poweroff(struct device *dev)
+{
+	return __isa_bus_suspend(dev, PMSG_HIBERNATE);
+}
+
 static int isa_bus_resume(struct device *dev)
 {
 	struct isa_driver *isa_driver = dev->platform_data;
@@ -83,14 +98,23 @@ static int isa_bus_resume(struct device *dev)
 	return 0;
 }
 
+static const struct dev_pm_ops isa_bus_dev_pm_ops = {
+	.suspend = isa_bus_suspend,
+	.resume = isa_bus_resume,
+	/* Hibernate callbacks */
+	.freeze = isa_bus_freeze,
+	.thaw = isa_bus_resume,
+	.poweroff = isa_bus_poweroff,
+	.restore = isa_bus_resume,
+};
+
 static struct bus_type isa_bus_type = {
 	.name		= "isa",
 	.match		= isa_bus_match,
 	.probe		= isa_bus_probe,
 	.remove		= isa_bus_remove,
 	.shutdown	= isa_bus_shutdown,
-	.suspend	= isa_bus_suspend,
-	.resume		= isa_bus_resume
+	.pm		= &isa_bus_dev_pm_ops,
 };
 
 static void isa_dev_release(struct device *dev)
-- 
1.7.10.4

--
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