diff options
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 0c5eff3bdc09..052e4caedb89 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; |