Skip to content

Commit

Permalink
pcmcia: ds: fix suspend/resume
Browse files Browse the repository at this point in the history
PCMCIA suspend/resume no longer works since the commit mentioned below,
as the callbacks are no longer made.  Convert the driver to the new
dev_pm_ops, which restores the suspend/resume functionality.  Tested on
the arm arch Assabet platform.

Fixes: aa8e54b ("PM / sleep: Go direct_complete if driver has no callbacks")
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
Russell King committed Sep 12, 2016
1 parent 9395452 commit ad8d52b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,15 +977,15 @@ static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env)

/************************ runtime PM support ***************************/

static int pcmcia_dev_suspend(struct device *dev, pm_message_t state);
static int pcmcia_dev_suspend(struct device *dev);
static int pcmcia_dev_resume(struct device *dev);

static int runtime_suspend(struct device *dev)
{
int rc;

device_lock(dev);
rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
rc = pcmcia_dev_suspend(dev);
device_unlock(dev);
return rc;
}
Expand Down Expand Up @@ -1135,7 +1135,7 @@ ATTRIBUTE_GROUPS(pcmcia_dev);

/* PM support, also needed for reset */

static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
static int pcmcia_dev_suspend(struct device *dev)
{
struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
struct pcmcia_driver *p_drv = NULL;
Expand Down Expand Up @@ -1410,6 +1410,9 @@ static struct class_interface pcmcia_bus_interface __refdata = {
.remove_dev = &pcmcia_bus_remove_socket,
};

static const struct dev_pm_ops pcmcia_bus_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)
};

struct bus_type pcmcia_bus_type = {
.name = "pcmcia",
Expand All @@ -1418,8 +1421,7 @@ struct bus_type pcmcia_bus_type = {
.dev_groups = pcmcia_dev_groups,
.probe = pcmcia_device_probe,
.remove = pcmcia_device_remove,
.suspend = pcmcia_dev_suspend,
.resume = pcmcia_dev_resume,
.pm = &pcmcia_bus_pm_ops,
};


Expand Down

0 comments on commit ad8d52b

Please sign in to comment.