diff options
-rw-r--r-- | drivers/mtd/maps/physmap.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 7c8cdf49deb6..42d844f8f6bf 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -201,8 +201,19 @@ static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state | |||
201 | int i; | 201 | int i; |
202 | 202 | ||
203 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) | 203 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) |
204 | if (info->mtd[i]->suspend) | 204 | if (info->mtd[i]->suspend) { |
205 | ret |= info->mtd[i]->suspend(info->mtd[i]); | 205 | ret = info->mtd[i]->suspend(info->mtd[i]); |
206 | if (ret) | ||
207 | goto fail; | ||
208 | } | ||
209 | |||
210 | return 0; | ||
211 | fail: | ||
212 | for (--i; i >= 0; --i) | ||
213 | if (info->mtd[i]->suspend) { | ||
214 | BUG_ON(!info->mtd[i]->resume); | ||
215 | info->mtd[i]->resume(info->mtd[i]); | ||
216 | } | ||
206 | 217 | ||
207 | return ret; | 218 | return ret; |
208 | } | 219 | } |