diff options
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r-- | drivers/mtd/maps/physmap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 1f6b9066b63e..7c8cdf49deb6 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -201,7 +201,8 @@ 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 | ret |= info->mtd[i]->suspend(info->mtd[i]); | 204 | if (info->mtd[i]->suspend) |
205 | ret |= info->mtd[i]->suspend(info->mtd[i]); | ||
205 | 206 | ||
206 | return ret; | 207 | return ret; |
207 | } | 208 | } |
@@ -212,7 +213,8 @@ static int physmap_flash_resume(struct platform_device *dev) | |||
212 | int i; | 213 | int i; |
213 | 214 | ||
214 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) | 215 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) |
215 | info->mtd[i]->resume(info->mtd[i]); | 216 | if (info->mtd[i]->resume) |
217 | info->mtd[i]->resume(info->mtd[i]); | ||
216 | 218 | ||
217 | return 0; | 219 | return 0; |
218 | } | 220 | } |
@@ -223,8 +225,9 @@ static void physmap_flash_shutdown(struct platform_device *dev) | |||
223 | int i; | 225 | int i; |
224 | 226 | ||
225 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) | 227 | for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++) |
226 | if (info->mtd[i]->suspend(info->mtd[i]) == 0) | 228 | if (info->mtd[i]->suspend && info->mtd[i]->resume) |
227 | info->mtd[i]->resume(info->mtd[i]); | 229 | if (info->mtd[i]->suspend(info->mtd[i]) == 0) |
230 | info->mtd[i]->resume(info->mtd[i]); | ||
228 | } | 231 | } |
229 | #else | 232 | #else |
230 | #define physmap_flash_suspend NULL | 233 | #define physmap_flash_suspend NULL |