From: Axel Lin Date: Tue, 1 Jan 2019 14:10:53 +0000 (+0800) Subject: spi: npcm-pspi: Fix wrong priv pointer X-Git-Tag: v5.15~6189^2~111^2~13^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=082531444e454bac6f743ec064203bf8812bc9ac;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c index e1dca79..734a2b95 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);