spi/qspi: set correct platform drvdata in ti_qspi_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 11 Nov 2013 06:13:41 +0000 (14:13 +0800)
committerMark Brown <broonie@linaro.org>
Sun, 24 Nov 2013 14:15:10 +0000 (14:15 +0000)
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>
drivers/spi/spi-ti-qspi.c

index 0b71270fbf67ba671dd43f116db48de30076514c..e147ed42e1fccb2773497a53c9349285fd9a6ef6 100644 (file)
@@ -459,11 +459,10 @@ static int ti_qspi_probe(struct platform_device *pdev)
        if (!of_property_read_u32(np, "num-cs", &num_cs))
                master->num_chipselect = num_cs;
 
-       platform_set_drvdata(pdev, master);
-
        qspi = spi_master_get_devdata(master);
        qspi->master = master;
        qspi->dev = &pdev->dev;
+       platform_set_drvdata(pdev, qspi);
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);