aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunihiko Hayashi <[email protected]>2021-12-22 13:48:12 +0900
committerMark Brown <[email protected]>2021-12-22 12:42:51 +0000
commit80bb73a9fbcde4ecc55e12f10c73fabbe68a24d1 (patch)
tree153a37cd4c4ff4357c30c147507a46c44d761f3b
parentdb6689b643d8653092f5853751ea2cdbc299f8d3 (diff)
spi: uniphier: Fix a bug that doesn't point to private data correctly
In uniphier_spi_remove(), there is a wrong code to get private data from the platform device, so the driver can't be removed properly. The driver should get spi_master from the platform device and retrieve the private data from it. Cc: <[email protected]> Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC") Signed-off-by: Kunihiko Hayashi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/spi/spi-uniphier.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index 8900e51e1a1c..342ee8d2c476 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -767,12 +767,13 @@ out_master_put:
static int uniphier_spi_remove(struct platform_device *pdev)
{
- struct uniphier_spi_priv *priv = platform_get_drvdata(pdev);
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct uniphier_spi_priv *priv = spi_master_get_devdata(master);
- if (priv->master->dma_tx)
- dma_release_channel(priv->master->dma_tx);
- if (priv->master->dma_rx)
- dma_release_channel(priv->master->dma_rx);
+ if (master->dma_tx)
+ dma_release_channel(master->dma_tx);
+ if (master->dma_rx)
+ dma_release_channel(master->dma_rx);
clk_disable_unprepare(priv->clk);