diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-11-27 01:41:45 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-27 16:31:34 +0000 |
commit | 5ffbe2d90d81b8734eaf69ee4dad8507f318aad0 (patch) | |
tree | be974a1245105285e4b34a39b85e465b5073eeca /drivers/spi/spi-rspi.c | |
parent | 8e1c8096faae6b8ac788a1bbeeea126044cb485a (diff) | |
download | lwn-5ffbe2d90d81b8734eaf69ee4dad8507f318aad0.tar.gz lwn-5ffbe2d90d81b8734eaf69ee4dad8507f318aad0.zip |
spi: rcar: Fix pointer cast in the remove function
The platform driver data is set to point to the rspi_data structure at
probe time. Calling spi_master_get() on the pointer is just plain wrong
and only works by chance. Fix it by using the platform driver data
directly.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-rspi.c')
-rw-r--r-- | drivers/spi/spi-rspi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index a3dca1dfd8ab..621be5dbea31 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -885,14 +885,13 @@ static void rspi_release_dma(struct rspi_data *rspi) 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); rspi_release_dma(rspi); free_irq(platform_get_irq(pdev, 0), rspi); clk_put(rspi->clk); iounmap(rspi->addr); - spi_master_put(rspi->master); return 0; } |