Commit e3d8bee3 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

spi: ti-qspi: Fix getting correct address for qspi

Now platform_get_drvdata() returns the address of qspi rather than master.
Also drop unneeded spi_unregister_master() call in ti_qspi_remove() because
we use devm_spi_register_master() in probe.

commit cbcabb7a "spi/qspi: Fix qspi remove path" assumes
platform_get_drvdata() returns address of master. However,
commit 160a0613 "spi/qspi: set correct platform drvdata in ti_qspi_probe()"
pass qspi to platform_set_drvdata().
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Reviewed-by: default avatarSourav Poddar <sourav.poddar@ti.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent f17414c4
...@@ -514,13 +514,9 @@ static int ti_qspi_probe(struct platform_device *pdev) ...@@ -514,13 +514,9 @@ static int ti_qspi_probe(struct platform_device *pdev)
static int ti_qspi_remove(struct platform_device *pdev) static int ti_qspi_remove(struct platform_device *pdev)
{ {
struct spi_master *master; struct ti_qspi *qspi = platform_get_drvdata(pdev);
struct ti_qspi *qspi;
int ret; int ret;
master = platform_get_drvdata(pdev);
qspi = spi_master_get_devdata(master);
ret = pm_runtime_get_sync(qspi->dev); ret = pm_runtime_get_sync(qspi->dev);
if (ret < 0) { if (ret < 0) {
dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); dev_err(qspi->dev, "pm_runtime_get_sync() failed\n");
...@@ -532,8 +528,6 @@ static int ti_qspi_remove(struct platform_device *pdev) ...@@ -532,8 +528,6 @@ static int ti_qspi_remove(struct platform_device *pdev)
pm_runtime_put(qspi->dev); pm_runtime_put(qspi->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
spi_unregister_master(master);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment