summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-npcm-pspi.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2019-01-01 17:10:53 +0300
committerMark Brown <broonie@kernel.org>2019-01-03 15:27:17 +0300
commit082531444e454bac6f743ec064203bf8812bc9ac (patch)
tree0706277265c121c4a09986c507f231e53b7104b9 /drivers/spi/spi-npcm-pspi.c
parent916d9802e4b0723c1e4650e58e04c0259c14b85c (diff)
downloadlinux-082531444e454bac6f743ec064203bf8812bc9ac.tar.xz
spi: npcm-pspi: Fix wrong priv pointer
In npcm_pspi_probe(), current code set platform_set_drvdata(pdev, master); so in npcm_pspi_remove() platform_get_drvdata(pdev) will return pointer to master rather than priv. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-npcm-pspi.c')
-rw-r--r--drivers/spi/spi-npcm-pspi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c
index e1dca79b9090..734a2b956959 100644
--- a/drivers/spi/spi-npcm-pspi.c
+++ b/drivers/spi/spi-npcm-pspi.c
@@ -465,7 +465,8 @@ out_master_put:
static int npcm_pspi_remove(struct platform_device *pdev)
{
- struct npcm_pspi *priv = platform_get_drvdata(pdev);
+ struct spi_master *master = platform_get_drvdata(pdev);
+ struct npcm_pspi *priv = spi_master_get_devdata(master);
npcm_pspi_reset_hw(priv);
clk_disable_unprepare(priv->clk);