spi/qspi: Fix runtime resume path
authorSourav Poddar <sourav.poddar@ti.com>
Fri, 20 Dec 2013 12:52:57 +0000 (18:22 +0530)
committerMark Brown <broonie@linaro.org>
Tue, 31 Dec 2013 12:55:59 +0000 (12:55 +0000)
Due to the following commit
commit 160a061301c7adf54c40696e7ceedc73f6b747dd
Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Date:   Mon Nov 11 14:13:41 2013 +0800

    spi/qspi: set correct platform drvdata in ti_qspi_probe()

    The ti_qspi_remove() use the platform drvdata as a type of
    struct ti_qspi, we should pass correct platform drvdata to
    platform_set_drvdata() in ti_qspi_probe().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>
platform_set_drvdata was changed in  the probe, so we need to
correspondingly change deferencing of qspi in runtime resume
path. Else, this will lead to a NULL dereference pointer.

Based on v3.13-rc3

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-ti-qspi.c

index 4396bd44854063d9488cfd5dadc863c40c9e1dbf..06ee18956160a98e5414692a664e67029bcb60e0 100644 (file)
@@ -417,10 +417,8 @@ out:
 static int ti_qspi_runtime_resume(struct device *dev)
 {
        struct ti_qspi      *qspi;
-       struct spi_master       *master;
 
-       master = dev_get_drvdata(dev);
-       qspi = spi_master_get_devdata(master);
+       qspi = dev_get_drvdata(dev);
        ti_qspi_restore_ctx(qspi);
 
        return 0;