diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-24 16:05:54 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-06-12 15:32:31 -0400 |
commit | e240b58c79144708530138e05f17c6d0d8d744a8 (patch) | |
tree | c42553ae8ffb034a767cebb0b4876db3528a2e11 | |
parent | d161630297a20802d01c55847bfcba85d2118a9f (diff) |
PM: Remove bus_type suspend_late()/resume_early() V2
Remove the ->suspend_late() and ->resume_early() callbacks
from struct bus_type V2. These callbacks are legacy stuff
at this point and since there seem to be no in-tree users
we may as well remove them. New users should use dev_pm_ops.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r-- | Documentation/power/devices.txt | 34 | ||||
-rw-r--r-- | drivers/base/power/main.c | 7 | ||||
-rw-r--r-- | include/linux/device.h | 2 |
3 files changed, 5 insertions, 38 deletions
diff --git a/Documentation/power/devices.txt b/Documentation/power/devices.txt index 421e7d00ffd0..c9abbd86bc18 100644 --- a/Documentation/power/devices.txt +++ b/Documentation/power/devices.txt | |||
@@ -75,9 +75,6 @@ may need to apply in domain-specific ways to their devices: | |||
75 | struct bus_type { | 75 | struct bus_type { |
76 | ... | 76 | ... |
77 | int (*suspend)(struct device *dev, pm_message_t state); | 77 | int (*suspend)(struct device *dev, pm_message_t state); |
78 | int (*suspend_late)(struct device *dev, pm_message_t state); | ||
79 | |||
80 | int (*resume_early)(struct device *dev); | ||
81 | int (*resume)(struct device *dev); | 78 | int (*resume)(struct device *dev); |
82 | }; | 79 | }; |
83 | 80 | ||
@@ -226,20 +223,7 @@ The phases are seen by driver notifications issued in this order: | |||
226 | 223 | ||
227 | This call should handle parts of device suspend logic that require | 224 | This call should handle parts of device suspend logic that require |
228 | sleeping. It probably does work to quiesce the device which hasn't | 225 | sleeping. It probably does work to quiesce the device which hasn't |
229 | been abstracted into class.suspend() or bus.suspend_late(). | 226 | been abstracted into class.suspend(). |
230 | |||
231 | 3 bus.suspend_late(dev, message) is called with IRQs disabled, and | ||
232 | with only one CPU active. Until the bus.resume_early() phase | ||
233 | completes (see later), IRQs are not enabled again. This method | ||
234 | won't be exposed by all busses; for message based busses like USB, | ||
235 | I2C, or SPI, device interactions normally require IRQs. This bus | ||
236 | call may be morphed into a driver call with bus-specific parameters. | ||
237 | |||
238 | This call might save low level hardware state that might otherwise | ||
239 | be lost in the upcoming low power state, and actually put the | ||
240 | device into a low power state ... so that in some cases the device | ||
241 | may stay partly usable until this late. This "late" call may also | ||
242 | help when coping with hardware that behaves badly. | ||
243 | 227 | ||
244 | The pm_message_t parameter is currently used to refine those semantics | 228 | The pm_message_t parameter is currently used to refine those semantics |
245 | (described later). | 229 | (described later). |
@@ -351,19 +335,11 @@ devices processing each phase's calls before the next phase begins. | |||
351 | 335 | ||
352 | The phases are seen by driver notifications issued in this order: | 336 | The phases are seen by driver notifications issued in this order: |
353 | 337 | ||
354 | 1 bus.resume_early(dev) is called with IRQs disabled, and with | 338 | 1 bus.resume(dev) reverses the effects of bus.suspend(). This may |
355 | only one CPU active. As with bus.suspend_late(), this method | 339 | be morphed into a device driver call with bus-specific parameters; |
356 | won't be supported on busses that require IRQs in order to | 340 | implementations may sleep. |
357 | interact with devices. | ||
358 | |||
359 | This reverses the effects of bus.suspend_late(). | ||
360 | |||
361 | 2 bus.resume(dev) is called next. This may be morphed into a device | ||
362 | driver call with bus-specific parameters; implementations may sleep. | ||
363 | |||
364 | This reverses the effects of bus.suspend(). | ||
365 | 341 | ||
366 | 3 class.resume(dev) is called for devices associated with a class | 342 | 2 class.resume(dev) is called for devices associated with a class |
367 | that has such a method. Implementations may sleep. | 343 | that has such a method. Implementations may sleep. |
368 | 344 | ||
369 | This reverses the effects of class.suspend(), and would usually | 345 | This reverses the effects of class.suspend(), and would usually |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 1f3d82260db4..68f9f3cecf7a 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -334,9 +334,6 @@ static int device_resume_noirq(struct device *dev, pm_message_t state) | |||
334 | if (dev->bus->pm) { | 334 | if (dev->bus->pm) { |
335 | pm_dev_dbg(dev, state, "EARLY "); | 335 | pm_dev_dbg(dev, state, "EARLY "); |
336 | error = pm_noirq_op(dev, dev->bus->pm, state); | 336 | error = pm_noirq_op(dev, dev->bus->pm, state); |
337 | } else if (dev->bus->resume_early) { | ||
338 | pm_dev_dbg(dev, state, "legacy EARLY "); | ||
339 | error = dev->bus->resume_early(dev); | ||
340 | } | 337 | } |
341 | End: | 338 | End: |
342 | TRACE_RESUME(error); | 339 | TRACE_RESUME(error); |
@@ -581,10 +578,6 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state) | |||
581 | if (dev->bus->pm) { | 578 | if (dev->bus->pm) { |
582 | pm_dev_dbg(dev, state, "LATE "); | 579 | pm_dev_dbg(dev, state, "LATE "); |
583 | error = pm_noirq_op(dev, dev->bus->pm, state); | 580 | error = pm_noirq_op(dev, dev->bus->pm, state); |
584 | } else if (dev->bus->suspend_late) { | ||
585 | pm_dev_dbg(dev, state, "legacy LATE "); | ||
586 | error = dev->bus->suspend_late(dev, state); | ||
587 | suspend_report_result(dev->bus->suspend_late, error); | ||
588 | } | 581 | } |
589 | return error; | 582 | return error; |
590 | } | 583 | } |
diff --git a/include/linux/device.h b/include/linux/device.h index 5d5c197bad45..84d79cde9f7d 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -62,8 +62,6 @@ struct bus_type { | |||
62 | void (*shutdown)(struct device *dev); | 62 | void (*shutdown)(struct device *dev); |
63 | 63 | ||
64 | int (*suspend)(struct device *dev, pm_message_t state); | 64 | int (*suspend)(struct device *dev, pm_message_t state); |
65 | int (*suspend_late)(struct device *dev, pm_message_t state); | ||
66 | int (*resume_early)(struct device *dev); | ||
67 | int (*resume)(struct device *dev); | 65 | int (*resume)(struct device *dev); |
68 | 66 | ||
69 | struct dev_pm_ops *pm; | 67 | struct dev_pm_ops *pm; |