|
@@ -202,9 +202,8 @@ static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state
|
|
int ret = 0;
|
|
int ret = 0;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- if (info)
|
|
|
|
- for (i = 0; i < MAX_RESOURCES; i++)
|
|
|
|
- ret |= info->mtd[i]->suspend(info->mtd[i]);
|
|
|
|
|
|
+ for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
|
|
|
|
+ ret |= info->mtd[i]->suspend(info->mtd[i]);
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
@@ -214,9 +213,9 @@ static int physmap_flash_resume(struct platform_device *dev)
|
|
struct physmap_flash_info *info = platform_get_drvdata(dev);
|
|
struct physmap_flash_info *info = platform_get_drvdata(dev);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- if (info)
|
|
|
|
- for (i = 0; i < MAX_RESOURCES; i++)
|
|
|
|
- info->mtd[i]->resume(info->mtd[i]);
|
|
|
|
|
|
+ for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
|
|
|
|
+ info->mtd[i]->resume(info->mtd[i]);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -225,8 +224,8 @@ static void physmap_flash_shutdown(struct platform_device *dev)
|
|
struct physmap_flash_info *info = platform_get_drvdata(dev);
|
|
struct physmap_flash_info *info = platform_get_drvdata(dev);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < MAX_RESOURCES; i++)
|
|
|
|
- if (info && info->mtd[i]->suspend(info->mtd[i]) == 0)
|
|
|
|
|
|
+ for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
|
|
|
|
+ if (info->mtd[i]->suspend(info->mtd[i]) == 0)
|
|
info->mtd[i]->resume(info->mtd[i]);
|
|
info->mtd[i]->resume(info->mtd[i]);
|
|
}
|
|
}
|
|
#else
|
|
#else
|