]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.7.7/pcmcia-ds-fix-suspend-resume.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.7.7 / pcmcia-ds-fix-suspend-resume.patch
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
5
6 From: Russell King <rmk+kernel@armlinux.org.uk>
7
8 commit ad8d52b897a14711e026889053befbbee7fd51ba upstream.
9
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.
14
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>
18
19 ---
20 drivers/pcmcia/ds.c | 12 +++++++-----
21 1 file changed, 7 insertions(+), 5 deletions(-)
22
23 --- a/drivers/pcmcia/ds.c
24 +++ b/drivers/pcmcia/ds.c
25 @@ -977,7 +977,7 @@ static int pcmcia_bus_uevent(struct devi
26
27 /************************ runtime PM support ***************************/
28
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);
32
33 static int runtime_suspend(struct device *dev)
34 @@ -985,7 +985,7 @@ static int runtime_suspend(struct device
35 int rc;
36
37 device_lock(dev);
38 - rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
39 + rc = pcmcia_dev_suspend(dev);
40 device_unlock(dev);
41 return rc;
42 }
43 @@ -1135,7 +1135,7 @@ ATTRIBUTE_GROUPS(pcmcia_dev);
44
45 /* PM support, also needed for reset */
46
47 -static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
48 +static int pcmcia_dev_suspend(struct device *dev)
49 {
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,
54 };
55
56 +static const struct dev_pm_ops pcmcia_bus_pm_ops = {
57 + SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)
58 +};
59
60 struct bus_type pcmcia_bus_type = {
61 .name = "pcmcia",
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,
69 };
70
71