diff mbox

spi/qspi: Fix runtime resume path

Message ID 1387543978-32309-1-git-send-email-sourav.poddar@ti.com (mailing list archive)
State Accepted
Commit f17414c4fcf138740dbbd463171101026b6f78de
Headers show

Commit Message

Poddar, Sourav Dec. 20, 2013, 12:52 p.m. UTC
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>
---
 drivers/spi/spi-ti-qspi.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Mark Brown Dec. 31, 2013, 12:58 p.m. UTC | #1
On Fri, Dec 20, 2013 at 06:22:57PM +0530, Sourav Poddar wrote:
> Due to the following commit
> commit 160a061301c7adf54c40696e7ceedc73f6b747dd
> Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> Date:   Mon Nov 11 14:13:41 2013 +0800

Applied.  You should *always* CC maintainers on patches, this would have
been applied a lot quicker if I'd actually seen it - this includes using
the e-mail address that gets advertised for stuff.  You sent this to my
Linaro address, not the one listed in MAINTAINERS.
diff mbox

Patch

diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
index 4396bd4..06ee189 100644
--- a/drivers/spi/spi-ti-qspi.c
+++ b/drivers/spi/spi-ti-qspi.c
@@ -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;