1 From ad8d52b897a14711e026889053befbbee7fd51ba Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@armlinux.org.uk>
3 Date: Wed, 31 Aug 2016 08:49:43 +0100
4 Subject: pcmcia: ds: fix suspend/resume
6 From: Russell King <rmk+kernel@armlinux.org.uk>
8 commit ad8d52b897a14711e026889053befbbee7fd51ba upstream.
10 PCMCIA suspend/resume no longer works since the commit mentioned below,
11 as the callbacks are no longer made. Convert the driver to the new
12 dev_pm_ops, which restores the suspend/resume functionality. Tested on
13 the arm arch Assabet platform.
15 Fixes: aa8e54b559479 ("PM / sleep: Go direct_complete if driver has no callbacks")
16 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 drivers/pcmcia/ds.c | 12 +++++++-----
21 1 file changed, 7 insertions(+), 5 deletions(-)
23 --- a/drivers/pcmcia/ds.c
24 +++ b/drivers/pcmcia/ds.c
25 @@ -977,7 +977,7 @@ static int pcmcia_bus_uevent(struct devi
27 /************************ runtime PM support ***************************/
29 -static int pcmcia_dev_suspend(struct device *dev, pm_message_t state);
30 +static int pcmcia_dev_suspend(struct device *dev);
31 static int pcmcia_dev_resume(struct device *dev);
33 static int runtime_suspend(struct device *dev)
34 @@ -985,7 +985,7 @@ static int runtime_suspend(struct device
38 - rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
39 + rc = pcmcia_dev_suspend(dev);
43 @@ -1135,7 +1135,7 @@ ATTRIBUTE_GROUPS(pcmcia_dev);
45 /* PM support, also needed for reset */
47 -static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
48 +static int pcmcia_dev_suspend(struct device *dev)
50 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
51 struct pcmcia_driver *p_drv = NULL;
52 @@ -1410,6 +1410,9 @@ static struct class_interface pcmcia_bus
53 .remove_dev = &pcmcia_bus_remove_socket,
56 +static const struct dev_pm_ops pcmcia_bus_pm_ops = {
57 + SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)
60 struct bus_type pcmcia_bus_type = {
62 @@ -1418,8 +1421,7 @@ struct bus_type pcmcia_bus_type = {
63 .dev_groups = pcmcia_dev_groups,
64 .probe = pcmcia_device_probe,
65 .remove = pcmcia_device_remove,
66 - .suspend = pcmcia_dev_suspend,
67 - .resume = pcmcia_dev_resume,
68 + .pm = &pcmcia_bus_pm_ops,