Skip to content

Commit

Permalink
[ARM] Fix Assabet reboot with SA1100 MTD map driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King authored and Russell King committed Oct 29, 2005
1 parent 183e1a3 commit 13bfb34
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/mtd/maps/sa1100-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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)
Expand Down

0 comments on commit 13bfb34

Please sign in to comment.