Call the spi_nor_rescan() only if the controller driver needs this support. This way SoCs that need this feature can use it. Signed-off-by: Kamal Dasu <kdasu.kdev@xxxxxxxxx> --- drivers/mtd/devices/m25p80.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 4528e33..ffdec60 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -328,8 +328,13 @@ static int m25p_suspend(struct device *dev) static int m25p_resume(struct device *dev) { struct m25p *flash = dev_get_drvdata(dev); + struct spi_device *spi = flash->spi; + int ret = 0; + + if (spi_flash_pm_supported(spi)) + ret = spi_nor_pm_rescan(&flash->spi_nor, NULL); - return spi_nor_pm_rescan(&flash->spi-nor, NULL); + return ret; } #endif static SIMPLE_DEV_PM_OPS(m25p_pm_ops, m25p_suspend, m25p_resume); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html