diff options
author | David Brownell <david-b@pacbell.net> | 2008-02-06 04:38:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:10 -0500 |
commit | 3c72426f0539c1abce17918d1456f7a6a5a11f90 (patch) | |
tree | 70f53c62825fc68b613b62f6ed0dcdd0bab736dd /drivers/spi | |
parent | 5ceadd2a2a9cf2768a9baf808abf1ffeedcc4cc4 (diff) |
spi core: stop updating dev->power.power_state
Don't update dev->power.power_state any more in the SPI core. The only
reason to update this scheduled-to-be-removed field was to make the
already-removed /sys/devices/.../power/state files work better.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 5e5d29bb2dd5..1ad12afc6ba0 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -76,39 +76,33 @@ static int spi_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
76 | 76 | ||
77 | #ifdef CONFIG_PM | 77 | #ifdef CONFIG_PM |
78 | 78 | ||
79 | /* | ||
80 | * NOTE: the suspend() method for an spi_master controller driver | ||
81 | * should verify that all its child devices are marked as suspended; | ||
82 | * suspend requests delivered through sysfs power/state files don't | ||
83 | * enforce such constraints. | ||
84 | */ | ||
85 | static int spi_suspend(struct device *dev, pm_message_t message) | 79 | static int spi_suspend(struct device *dev, pm_message_t message) |
86 | { | 80 | { |
87 | int value; | 81 | int value = 0; |
88 | struct spi_driver *drv = to_spi_driver(dev->driver); | 82 | struct spi_driver *drv = to_spi_driver(dev->driver); |
89 | 83 | ||
90 | if (!drv || !drv->suspend) | ||
91 | return 0; | ||
92 | |||
93 | /* suspend will stop irqs and dma; no more i/o */ | 84 | /* suspend will stop irqs and dma; no more i/o */ |
94 | value = drv->suspend(to_spi_device(dev), message); | 85 | if (drv) { |
95 | if (value == 0) | 86 | if (drv->suspend) |
96 | dev->power.power_state = message; | 87 | value = drv->suspend(to_spi_device(dev), message); |
88 | else | ||
89 | dev_dbg(dev, "... can't suspend\n"); | ||
90 | } | ||
97 | return value; | 91 | return value; |
98 | } | 92 | } |
99 | 93 | ||
100 | static int spi_resume(struct device *dev) | 94 | static int spi_resume(struct device *dev) |
101 | { | 95 | { |
102 | int value; | 96 | int value = 0; |
103 | struct spi_driver *drv = to_spi_driver(dev->driver); | 97 | struct spi_driver *drv = to_spi_driver(dev->driver); |
104 | 98 | ||
105 | if (!drv || !drv->resume) | ||
106 | return 0; | ||
107 | |||
108 | /* resume may restart the i/o queue */ | 99 | /* resume may restart the i/o queue */ |
109 | value = drv->resume(to_spi_device(dev)); | 100 | if (drv) { |
110 | if (value == 0) | 101 | if (drv->resume) |
111 | dev->power.power_state = PMSG_ON; | 102 | value = drv->resume(to_spi_device(dev)); |
103 | else | ||
104 | dev_dbg(dev, "... can't resume\n"); | ||
105 | } | ||
112 | return value; | 106 | return value; |
113 | } | 107 | } |
114 | 108 | ||