diff options
author | Russell King <rmk@arm.linux.org.uk> | 2005-10-28 12:52:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 12:52:56 -0400 |
commit | 9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch) | |
tree | 967e26d3a23c24dd52b114d672312c207714308c /arch/arm/mach-sa1100/neponset.c | |
parent | a3a3395e487abc4c1371fe319a8ecbb3913a70a4 (diff) |
[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then
all devices were called at SUSPEND_SAVE_STATE level, and finally
SUSPEND_POWER_DOWN level. However, with PM v2, to maintain
compatibility for platform devices, I arranged for the PM v2
suspend/resume callbacks to call the old PM v1 suspend/resume
callbacks three times with each level in order so that existing
drivers continued to work.
Since this is obsolete infrastructure which is no longer necessary,
we can remove it. Here's an (untested) patch to do exactly that.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm/mach-sa1100/neponset.c')
-rw-r--r-- | arch/arm/mach-sa1100/neponset.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index fc061641b7be..7609d69cf1cc 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c | |||
@@ -178,33 +178,27 @@ static int neponset_probe(struct device *dev) | |||
178 | /* | 178 | /* |
179 | * LDM power management. | 179 | * LDM power management. |
180 | */ | 180 | */ |
181 | static int neponset_suspend(struct device *dev, pm_message_t state, u32 level) | 181 | static int neponset_suspend(struct device *dev, pm_message_t state) |
182 | { | 182 | { |
183 | /* | 183 | /* |
184 | * Save state. | 184 | * Save state. |
185 | */ | 185 | */ |
186 | if (level == SUSPEND_SAVE_STATE || | 186 | if (!dev->power.saved_state) |
187 | level == SUSPEND_DISABLE || | 187 | dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); |
188 | level == SUSPEND_POWER_DOWN) { | 188 | if (!dev->power.saved_state) |
189 | if (!dev->power.saved_state) | 189 | return -ENOMEM; |
190 | dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); | 190 | |
191 | if (!dev->power.saved_state) | 191 | *(unsigned int *)dev->power.saved_state = NCR_0; |
192 | return -ENOMEM; | ||
193 | |||
194 | *(unsigned int *)dev->power.saved_state = NCR_0; | ||
195 | } | ||
196 | 192 | ||
197 | return 0; | 193 | return 0; |
198 | } | 194 | } |
199 | 195 | ||
200 | static int neponset_resume(struct device *dev, u32 level) | 196 | static int neponset_resume(struct device *dev) |
201 | { | 197 | { |
202 | if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) { | 198 | if (dev->power.saved_state) { |
203 | if (dev->power.saved_state) { | 199 | NCR_0 = *(unsigned int *)dev->power.saved_state; |
204 | NCR_0 = *(unsigned int *)dev->power.saved_state; | 200 | kfree(dev->power.saved_state); |
205 | kfree(dev->power.saved_state); | 201 | dev->power.saved_state = NULL; |
206 | dev->power.saved_state = NULL; | ||
207 | } | ||
208 | } | 202 | } |
209 | 203 | ||
210 | return 0; | 204 | return 0; |