Skip to content

Commit 23e3404

Browse files
khayash1broonie
authored andcommitted
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: <stable@vger.kernel.org> Fixes: 5ba155a ("spi: add SPI controller driver for UniPhier SoC") Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Link: https://lore.kernel.org/r/1640148492-32178-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 90cafce commit 23e3404

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/spi/spi-uniphier.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -767,12 +767,13 @@ static int uniphier_spi_probe(struct platform_device *pdev)
767767

768768
static int uniphier_spi_remove(struct platform_device *pdev)
769769
{
770-
struct uniphier_spi_priv *priv = platform_get_drvdata(pdev);
770+
struct spi_master *master = platform_get_drvdata(pdev);
771+
struct uniphier_spi_priv *priv = spi_master_get_devdata(master);
771772

772-
if (priv->master->dma_tx)
773-
dma_release_channel(priv->master->dma_tx);
774-
if (priv->master->dma_rx)
775-
dma_release_channel(priv->master->dma_rx);
773+
if (master->dma_tx)
774+
dma_release_channel(master->dma_tx);
775+
if (master->dma_rx)
776+
dma_release_channel(master->dma_rx);
776777

777778
clk_disable_unprepare(priv->clk);
778779

0 commit comments

Comments
 (0)