Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b249191 authored by Robert Jarzmik's avatar Robert Jarzmik Committed by David Woodhouse
Browse files

[MTD] physmap: Fix suspend/resume/shutdown bugs.



Don't call suspend/resume functions if they have not been
defined.

Signed-off-by: default avatarRobert Jarzmik <rjarzmik@free.fr>
Acked-By: default avatarJörn Engel <joern@logfs.org>
Signed-off-by: default avatarUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 998453fb
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ static int physmap_flash_suspend(struct platform_device *dev, pm_message_t state
	int i;

	for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
		if (info->mtd[i]->suspend)
			ret |= info->mtd[i]->suspend(info->mtd[i]);

	return ret;
@@ -212,6 +213,7 @@ static int physmap_flash_resume(struct platform_device *dev)
	int i;

	for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
		if (info->mtd[i]->resume)
			info->mtd[i]->resume(info->mtd[i]);

	return 0;
@@ -223,6 +225,7 @@ static void physmap_flash_shutdown(struct platform_device *dev)
	int i;

	for (i = 0; i < MAX_RESOURCES && info->mtd[i]; i++)
		if (info->mtd[i]->suspend && info->mtd[i]->resume)
			if (info->mtd[i]->suspend(info->mtd[i]) == 0)
				info->mtd[i]->resume(info->mtd[i]);
}