diff options
-rw-r--r-- | drivers/base/power/suspend.c | 27 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 14 | ||||
-rw-r--r-- | include/linux/device.h | 1 | ||||
-rw-r--r-- | include/linux/pci.h | 1 | ||||
-rw-r--r-- | kernel/power/main.c | 4 |
5 files changed, 0 insertions, 47 deletions
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index e86db83746ac..6453c25103d2 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c | |||
@@ -118,33 +118,6 @@ static int suspend_device_late(struct device *dev, pm_message_t state) | |||
118 | } | 118 | } |
119 | 119 | ||
120 | /** | 120 | /** |
121 | * device_prepare_suspend - save state and prepare to suspend | ||
122 | * | ||
123 | * NOTE! Devices cannot detach at this point - not only do we | ||
124 | * hold the device list semaphores over the whole prepare, but | ||
125 | * the whole point is to do non-invasive preparatory work, not | ||
126 | * the actual suspend. | ||
127 | */ | ||
128 | int device_prepare_suspend(pm_message_t state) | ||
129 | { | ||
130 | int error = 0; | ||
131 | struct device * dev; | ||
132 | |||
133 | down(&dpm_sem); | ||
134 | down(&dpm_list_sem); | ||
135 | list_for_each_entry_reverse(dev, &dpm_active, power.entry) { | ||
136 | if (!dev->bus || !dev->bus->suspend_prepare) | ||
137 | continue; | ||
138 | error = dev->bus->suspend_prepare(dev, state); | ||
139 | if (error) | ||
140 | break; | ||
141 | } | ||
142 | up(&dpm_list_sem); | ||
143 | up(&dpm_sem); | ||
144 | return error; | ||
145 | } | ||
146 | |||
147 | /** | ||
148 | * device_suspend - Save state and stop all devices in system. | 121 | * device_suspend - Save state and stop all devices in system. |
149 | * @state: Power state to put each device in. | 122 | * @state: Power state to put each device in. |
150 | * | 123 | * |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 9e7d6ceb3805..8948ac9ab681 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -264,19 +264,6 @@ static int pci_device_remove(struct device * dev) | |||
264 | return 0; | 264 | return 0; |
265 | } | 265 | } |
266 | 266 | ||
267 | static int pci_device_suspend_prepare(struct device * dev, pm_message_t state) | ||
268 | { | ||
269 | struct pci_dev * pci_dev = to_pci_dev(dev); | ||
270 | struct pci_driver * drv = pci_dev->driver; | ||
271 | int i = 0; | ||
272 | |||
273 | if (drv && drv->suspend_prepare) { | ||
274 | i = drv->suspend_prepare(pci_dev, state); | ||
275 | suspend_report_result(drv->suspend_prepare, i); | ||
276 | } | ||
277 | return i; | ||
278 | } | ||
279 | |||
280 | static int pci_device_suspend(struct device * dev, pm_message_t state) | 267 | static int pci_device_suspend(struct device * dev, pm_message_t state) |
281 | { | 268 | { |
282 | struct pci_dev * pci_dev = to_pci_dev(dev); | 269 | struct pci_dev * pci_dev = to_pci_dev(dev); |
@@ -544,7 +531,6 @@ struct bus_type pci_bus_type = { | |||
544 | .uevent = pci_uevent, | 531 | .uevent = pci_uevent, |
545 | .probe = pci_device_probe, | 532 | .probe = pci_device_probe, |
546 | .remove = pci_device_remove, | 533 | .remove = pci_device_remove, |
547 | .suspend_prepare= pci_device_suspend_prepare, | ||
548 | .suspend = pci_device_suspend, | 534 | .suspend = pci_device_suspend, |
549 | .suspend_late = pci_device_suspend_late, | 535 | .suspend_late = pci_device_suspend_late, |
550 | .resume_early = pci_device_resume_early, | 536 | .resume_early = pci_device_resume_early, |
diff --git a/include/linux/device.h b/include/linux/device.h index b40be6fca6fa..b3646462d6dc 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -52,7 +52,6 @@ struct bus_type { | |||
52 | int (*remove)(struct device * dev); | 52 | int (*remove)(struct device * dev); |
53 | void (*shutdown)(struct device * dev); | 53 | void (*shutdown)(struct device * dev); |
54 | 54 | ||
55 | int (*suspend_prepare)(struct device * dev, pm_message_t state); | ||
56 | int (*suspend)(struct device * dev, pm_message_t state); | 55 | int (*suspend)(struct device * dev, pm_message_t state); |
57 | int (*suspend_late)(struct device * dev, pm_message_t state); | 56 | int (*suspend_late)(struct device * dev, pm_message_t state); |
58 | int (*resume_early)(struct device * dev); | 57 | int (*resume_early)(struct device * dev); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 4b2e629467c7..9514bbfe96e2 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -345,7 +345,6 @@ struct pci_driver { | |||
345 | const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ | 345 | const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ |
346 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ | 346 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ |
347 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ | 347 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ |
348 | int (*suspend_prepare) (struct pci_dev *dev, pm_message_t state); | ||
349 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ | 348 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ |
350 | int (*suspend_late) (struct pci_dev *dev, pm_message_t state); | 349 | int (*suspend_late) (struct pci_dev *dev, pm_message_t state); |
351 | int (*resume_early) (struct pci_dev *dev); | 350 | int (*resume_early) (struct pci_dev *dev); |
diff --git a/kernel/power/main.c b/kernel/power/main.c index 0c3ed6ac938e..6d295c776794 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -57,10 +57,6 @@ static int suspend_prepare(suspend_state_t state) | |||
57 | if (!pm_ops || !pm_ops->enter) | 57 | if (!pm_ops || !pm_ops->enter) |
58 | return -EPERM; | 58 | return -EPERM; |
59 | 59 | ||
60 | error = device_prepare_suspend(PMSG_SUSPEND); | ||
61 | if (error) | ||
62 | return error; | ||
63 | |||
64 | pm_prepare_console(); | 60 | pm_prepare_console(); |
65 | 61 | ||
66 | disable_nonboot_cpus(); | 62 | disable_nonboot_cpus(); |