diff -drupN a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c --- a/drivers/mtd/devices/m25p80.c 2018-08-06 17:23:04.000000000 +0300 +++ b/drivers/mtd/devices/m25p80.c 2022-06-12 05:28:14.000000000 +0300 @@ -258,6 +258,13 @@ static int m25p_remove(struct spi_device return mtd_device_unregister(&flash->spi_nor.mtd); } +static void m25p_shutdown(struct spi_device *spi) +{ + struct m25p *flash = spi_get_drvdata(spi); + + spi_nor_restore(&flash->spi_nor); +} + /* * Do NOT add to this array without reading the following: * @@ -291,7 +298,7 @@ static const struct spi_device_id m25p_i {"at25df321a"}, {"at25df641"}, {"at26df081a"}, {"mr25h256"}, {"mx25l4005a"}, {"mx25l1606e"}, {"mx25l6405d"}, {"mx25l12805d"}, - {"mx25l25635e"},{"mx66l51235l"}, + {"mx25l25635e"}, {"mx66l51235l"}, {"mx25l12835f"}, {"n25q064"}, {"n25q128a11"}, {"n25q128a13"}, {"n25q512a"}, {"s25fl256s1"}, {"s25fl512s"}, {"s25sl12801"}, {"s25fl008k"}, {"s25fl064k"}, @@ -323,11 +330,13 @@ MODULE_DEVICE_TABLE(of, m25p_of_table); static struct spi_driver m25p80_driver = { .driver = { .name = "m25p80", + .pm = NULL, .of_match_table = m25p_of_table, }, .id_table = m25p_ids, .probe = m25p_probe, .remove = m25p_remove, + .shutdown = m25p_shutdown, /* REVISIT: many of these chips have deep power-down modes, which * should clearly be entered on suspend() to minimize power use.