Commit 53063ec6 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown

spi: rspi: use platform drvdata correctly in rspi_remove()

We had set the platform drvdata in rspi_probe() as a type of
struct rspi_data, but use it as struct spi_master in rspi_remove()
Fix by remove the unnecessary spi_master_[get|put]() since rspi->master
is no longer used after spi_unregister_master().
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 82f85cf9
...@@ -885,14 +885,13 @@ static void rspi_release_dma(struct rspi_data *rspi) ...@@ -885,14 +885,13 @@ static void rspi_release_dma(struct rspi_data *rspi)
static int rspi_remove(struct platform_device *pdev) static int rspi_remove(struct platform_device *pdev)
{ {
struct rspi_data *rspi = spi_master_get(platform_get_drvdata(pdev)); struct rspi_data *rspi = platform_get_drvdata(pdev);
spi_unregister_master(rspi->master); spi_unregister_master(rspi->master);
rspi_release_dma(rspi); rspi_release_dma(rspi);
free_irq(platform_get_irq(pdev, 0), rspi); free_irq(platform_get_irq(pdev, 0), rspi);
clk_put(rspi->clk); clk_put(rspi->clk);
iounmap(rspi->addr); iounmap(rspi->addr);
spi_master_put(rspi->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