summaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-27 01:41:35 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-27 01:41:35 +0200
commitce63e1862ce81d85df9e3239e4467ac765e04962 (patch)
tree710af3f57b7fe25355088f8542f38a791b05b65d /drivers/pnp
parentMerge branch 'acpi-video' (diff)
parentPNP: convert PNP driver bus legacy pm_ops to dev_pm_ops (diff)
downloadlinux-ce63e1862ce81d85df9e3239e4467ac765e04962.tar.xz
linux-ce63e1862ce81d85df9e3239e4467ac765e04962.zip
Merge branch 'pnp'
* pnp: PNP: convert PNP driver bus legacy pm_ops to dev_pm_ops
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/driver.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 00e94032531a..12adb43a0693 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -154,7 +154,7 @@ static int pnp_bus_match(struct device *dev, struct device_driver *drv)
return 1;
}
-static int pnp_bus_suspend(struct device *dev, pm_message_t state)
+static int __pnp_bus_suspend(struct device *dev, pm_message_t state)
{
struct pnp_dev *pnp_dev = to_pnp_dev(dev);
struct pnp_driver *pnp_drv = pnp_dev->driver;
@@ -180,6 +180,16 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state)
return 0;
}
+static int pnp_bus_suspend(struct device *dev)
+{
+ return __pnp_bus_suspend(dev, PMSG_SUSPEND);
+}
+
+static int pnp_bus_freeze(struct device *dev)
+{
+ return __pnp_bus_suspend(dev, PMSG_FREEZE);
+}
+
static int pnp_bus_resume(struct device *dev)
{
struct pnp_dev *pnp_dev = to_pnp_dev(dev);
@@ -210,14 +220,19 @@ static int pnp_bus_resume(struct device *dev)
return 0;
}
+static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
+ .suspend = pnp_bus_suspend,
+ .freeze = pnp_bus_freeze,
+ .resume = pnp_bus_resume,
+};
+
struct bus_type pnp_bus_type = {
.name = "pnp",
.match = pnp_bus_match,
.probe = pnp_device_probe,
.remove = pnp_device_remove,
.shutdown = pnp_device_shutdown,
- .suspend = pnp_bus_suspend,
- .resume = pnp_bus_resume,
+ .pm = &pnp_bus_dev_pm_ops,
.dev_attrs = pnp_interface_attrs,
};