diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-10-29 16:14:08 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-10-29 16:14:08 +0100 |
commit | 13bfb34c10fae6016710f5f070043c8b94b40583 (patch) | |
tree | 39fd757bdfa95381655e0e2130c054834ee807e2 /drivers/mtd | |
parent | 183e1a349466a1b90430a58f3efad25a3e555cb2 (diff) |
[ARM] Fix Assabet reboot with SA1100 MTD map driver
Unfortunately, some devices forgot to reset the flash on reboot.
Arrange for the map driver to suspend & resume the flash to
ensure that it is in a sane state before rebooting.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/sa1100-flash.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c index acf01ef9b575..c81bec7b14d5 100644 --- a/drivers/mtd/maps/sa1100-flash.c +++ b/drivers/mtd/maps/sa1100-flash.c @@ -440,9 +440,17 @@ static int sa1100_mtd_resume(struct device *dev) info->mtd->resume(info->mtd); return 0; } + +static void sa1100_mtd_shutdown(struct device *dev) +{ + struct sa_info *info = dev_get_drvdata(dev); + if (info && info->mtd->suspend(info->mtd) == 0) + info->mtd->resume(info->mtd); +} #else #define sa1100_mtd_suspend NULL #define sa1100_mtd_resume NULL +#define sa1100_mtd_shutdown NULL #endif static struct device_driver sa1100_mtd_driver = { @@ -452,6 +460,7 @@ static struct device_driver sa1100_mtd_driver = { .remove = __exit_p(sa1100_mtd_remove), .suspend = sa1100_mtd_suspend, .resume = sa1100_mtd_resume, + .shutdown = sa1100_mtd_shutdown, }; static int __init sa1100_mtd_init(void) |