mtd: m25p80: restore the status of SPI flash when exiting
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Wed, 6 Dec 2017 02:53:42 +0000 (10:53 +0800)
committerCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Tue, 12 Dec 2017 23:36:00 +0000 (00:36 +0100)
commit59b356ffd0b00ed986c0aa1b401dd9b466ee619d
treeaa857546f8f2f63b52db020894b54cbab16e8a18
parent8dee1d971af9af2f7b5f54c2eac4ebd04c5c237c
mtd: m25p80: restore the status of SPI flash when exiting

Restore the status to be compatible with legacy devices.
Take Freescale eSPI boot for example, it copies (in 3 Byte
addressing mode) the RCW and bootloader images from SPI flash
without firing a reset signal previously, so the reboot command
will fail without resetting the addressing mode of SPI flash.
This patch implements .shutdown function to restore the status
in reboot process, and add the same operation to the .remove
function.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
drivers/mtd/devices/m25p80.c