spi: ti-qspi: Fix getting correct address for qspi
PATCH v2 1/1 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 cbcabb7a300b "spi/qspi: Fix qspi remove path" assumes platform_get_drvdata() returns address of master. However,
commit 160a061301c7 "spi/qspi: set correct platform drvdata in ti_qspi_probe()" pass qspi to platform_set_drvdata().
---
v2: Update commit log, and drop fixes tag ( the fixes commit id is wrong).
drivers/spi/spi-ti-qspi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/spi/spi-ti-qspi.c +1 -7
@@ -563,13 +563,9 @@ free_master:static int ti_qspi_remove (struct platform_device *pdev) { -struct spi_master *master; -struct ti_qspi *qspi; +struct ti_qspi *qspi =platform_get_drvdata (pdev);int ret; - master =platform_get_drvdata (pdev); - qspi =spi_master_get_devdata (master); - ret =pm_runtime_get_sync (qspi->dev);if (ret <0 ) {dev_err (qspi->dev,"pm_runtime_get_sync() failed\n" );
@@ -581,8 +577,6 @@ static int ti_qspi_remove(struct platform_device *pdev)pm_runtime_put (qspi->dev);pm_runtime_disable (&pdev->dev); -spi_unregister_master (master); -return 0 ; }
Signature · 8 lines
1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 36 lines · Axel Lin
Now
platform_get_drvdata()returns the address of qspi rather than master. Also drop unneededspi_unregister_master()call inti_qspi_remove()because we usedevm_spi_register_master()in probe.commit
cbcabb7a300b"spi/qspi: Fix qspi remove path" assumesplatform_get_drvdata()returns address of master. However,
commit160a061301c7"spi/qspi: set correct platform drvdata inti_qspi_probe()" pass qspi toplatform_set_drvdata().Signed-off-by Axel Lin<[email protected]>---
v2: Update commit log, and drop fixes tag ( the fixes commit id is wrong).drivers/spi/spi-ti-qspi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)drivers/spi/spi-ti-qspi.c +1
-5@@ -563,13 +563,9 @@ free_master:static int ti_qspi_remove (struct platform_device *pdev) { -struct spi_master *master; -struct ti_qspi *qspi; +struct ti_qspi *qspi =platform_get_drvdata (pdev);int ret; - master =platform_get_drvdata (pdev); - qspi =spi_master_get_devdata (master); - ret =pm_runtime_get_sync (qspi->dev);if (ret<0 ) {dev_err (qspi->dev,"pm_runtime_get_sync() failed\n" );
drivers/spi/spi-ti-qspi.c static int ti_qspi_remove(struct platform_device *pdev) · line 585
Quoted 5 lines
drivers/spi/spi-ti-qspi.c +0
-2@@ -581,8 +577,6 @@ static int ti_qspi_remove(struct platform_device *pdev)pm_runtime_put (qspi->dev);pm_runtime_disable (&pdev->dev); -spi_unregister_master (master); -
why this is removed?
drivers/spi/spi-ti-qspi.c static int ti_qspi_remove(struct platform_device *pdev) · line 582
Quoted 3 lines
drivers/spi/spi-ti-qspi.c +0
-0return 0 ; }
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
2014/1/7 Sourav Poddar <[email protected]>:
Quoted 44 lines · Axel Lin
Quoted 43 lines
Now
platform_get_drvdata()returns the address of qspi rather than master. Also drop unneededspi_unregister_master()call inti_qspi_remove()because
we usedevm_spi_register_master()in probe.commit
cbcabb7a300b"spi/qspi: Fix qspi remove path" assumesplatform_get_drvdata()returns address of master. However, commit160a061301c7"spi/qspi: set correct platform drvdata inti_qspi_probe()"
pass qspi toplatform_set_drvdata().Signed-off-by Axel Lin<[email protected]>---
v2: Update commit log, and drop fixes tag ( the fixes commit id is wrong).drivers/spi/spi-ti-qspi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)drivers/spi/spi-ti-qspi.c +1
-5@@ -563,13 +563,9 @@ free_master:static int ti_qspi_remove (struct platform_device *pdev) { -struct spi_master *master; -struct ti_qspi *qspi; +struct ti_qspi *qspi =platform_get_drvdata (pdev);int ret; - master =platform_get_drvdata (pdev); - qspi =spi_master_get_devdata (master); - ret =pm_runtime_get_sync (qspi->dev);if (ret<0 ) {dev_err (qspi->dev,"pm_runtime_get_sync() failed\n" );@@ -581,8 +577,6 @@ static int ti_qspi_remove(struct platform_device *pdev)pm_runtime_put (qspi->dev);pm_runtime_disable (&pdev->dev);
Quoted 4 lines
drivers/spi/spi-ti-qspi.c static int ti_qspi_remove(struct platform_device *pdev) · line 585
Quoted 2 lines
drivers/spi/spi-ti-qspi.c +0
-2-spi_unregister_master (master); -why this is removed?
If you use spi_register_master(), then you need to call spi_unregister_master() in ti_qspi_remove().
However, current code uses devm_spi_register_master(). So you don't need to expilictly call spi_unregister_master(). It's done by devm_* APIs.
Regards,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAFRkauC=5Ls=AUi4HWJPfu3uL2XVP5b6w8U+z8fnqVSTkXPE_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Sourav Poddar
Reviewed-byQuoted 47 lines · Axel Lin
2014/1/7 Sourav Poddar<[email protected]>:
Quoted 43 lines · Axel Lin
Quoted 42 lines
Now
platform_get_drvdata()returns the address of qspi rather than master. Also drop unneededspi_unregister_master()call inti_qspi_remove()because
we usedevm_spi_register_master()in probe.commit
cbcabb7a300b"spi/qspi: Fix qspi remove path" assumesplatform_get_drvdata()returns address of master. However, commit160a061301c7"spi/qspi: set correct platform drvdata inti_qspi_probe()"
pass qspi toplatform_set_drvdata().Signed-off-by Axel Lin<[email protected]>---
v2: Update commit log, and drop fixes tag ( the fixes commit id is wrong).drivers/spi/spi-ti-qspi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)drivers/spi/spi-ti-qspi.c +1
-5@@ -563,13 +563,9 @@ free_master:static int ti_qspi_remove (struct platform_device *pdev) { -struct spi_master *master; -struct ti_qspi *qspi; +struct ti_qspi *qspi =platform_get_drvdata (pdev);int ret; - master =platform_get_drvdata (pdev); - qspi =spi_master_get_devdata (master); - ret =pm_runtime_get_sync (qspi->dev);if (ret<0 ) {dev_err (qspi->dev,"pm_runtime_get_sync() failed\n" );@@ -581,8 +577,6 @@ static int ti_qspi_remove(struct platform_device *pdev)pm_runtime_put (qspi->dev);pm_runtime_disable (&pdev->dev);Quoted 3 lines
drivers/spi/spi-ti-qspi.c static int ti_qspi_remove(struct platform_device *pdev) · line 585
Quoted 2 lines
drivers/spi/spi-ti-qspi.c +0
-2-spi_unregister_master (master); -why this is removed?
Quoted 7 lines
If you use
spi_register_master(), then you need to callspi_unregister_master()inti_qspi_remove().
However, current code usesdevm_spi_register_master(). So you don't need to expilictly callspi_unregister_master(). It's done by devm_* APIs.Regards,
Axel
hmm..missed that point.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Mark Brown
AppliedQuoted 3 lines · Axel Lin
Now
platform_get_drvdata()returns the address of qspi rather than master. Also drop unneededspi_unregister_master()call inti_qspi_remove()because we usedevm_spi_register_master()in probe.
Applied, thanks.