Commit 8a37ea50 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Rafael J. Wysocki

PNP: fix restoring devices after hibernation

On returning from hibernation 'restore' callback is called,
not 'resume'.  Fix it.

Fixes: eaf140b6 (PNP: convert PNP driver bus legacy pm_ops to dev_pm_ops)
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: 3.12+ <stable@vger.kernel.org> # 3.12+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent dc1ccc48
...@@ -197,6 +197,11 @@ static int pnp_bus_freeze(struct device *dev) ...@@ -197,6 +197,11 @@ static int pnp_bus_freeze(struct device *dev)
return __pnp_bus_suspend(dev, PMSG_FREEZE); return __pnp_bus_suspend(dev, PMSG_FREEZE);
} }
static int pnp_bus_poweroff(struct device *dev)
{
return __pnp_bus_suspend(dev, PMSG_HIBERNATE);
}
static int pnp_bus_resume(struct device *dev) static int pnp_bus_resume(struct device *dev)
{ {
struct pnp_dev *pnp_dev = to_pnp_dev(dev); struct pnp_dev *pnp_dev = to_pnp_dev(dev);
...@@ -234,9 +239,14 @@ static int pnp_bus_resume(struct device *dev) ...@@ -234,9 +239,14 @@ static int pnp_bus_resume(struct device *dev)
} }
static const struct dev_pm_ops pnp_bus_dev_pm_ops = { static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
/* Suspend callbacks */
.suspend = pnp_bus_suspend, .suspend = pnp_bus_suspend,
.freeze = pnp_bus_freeze,
.resume = pnp_bus_resume, .resume = pnp_bus_resume,
/* Hibernate callbacks */
.freeze = pnp_bus_freeze,
.thaw = pnp_bus_resume,
.poweroff = pnp_bus_poweroff,
.restore = pnp_bus_resume,
}; };
struct bus_type pnp_bus_type = { struct bus_type pnp_bus_type = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment