mirror of https://gitee.com/openkylin/linux.git
spi: uniphier: Fix a bug that doesn't point to private data correctly
commit80bb73a9fb
upstream. 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:5ba155a4d4
("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e53802534c
commit
0d9b780cb3
|
@ -767,12 +767,13 @@ static int uniphier_spi_probe(struct platform_device *pdev)
|
|||
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue