All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: npcm-pspi: Fix wrong priv pointer
@ 2019-01-01 14:10 Axel Lin
  2019-01-03 13:53 ` Applied "spi: npcm-pspi: Fix wrong priv pointer" to the spi tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2019-01-01 14:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Avi Fishman, Tomer Maimon, Patrick Venture, Nancy Yuen,
	Brendan Higgins, openbmc, linux-spi, Axel Lin

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>
---
 drivers/spi/spi-npcm-pspi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 @@ static int npcm_pspi_probe(struct platform_device *pdev)
 
 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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Applied "spi: npcm-pspi: Fix wrong priv pointer" to the spi tree
  2019-01-01 14:10 [PATCH] spi: npcm-pspi: Fix wrong priv pointer Axel Lin
@ 2019-01-03 13:53 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2019-01-03 13:53 UTC (permalink / raw)
  To: Axel Lin
  Cc: Mark Brown, Mark Brown, Avi Fishman, Tomer Maimon,
	Patrick Venture, Nancy Yuen, Brendan Higgins, openbmc, linux-spi,
	linux-spi

The patch

   spi: npcm-pspi: Fix wrong priv pointer

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 082531444e454bac6f743ec064203bf8812bc9ac Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Tue, 1 Jan 2019 22:10:53 +0800
Subject: [PATCH] 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>
---
 drivers/spi/spi-npcm-pspi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 @@ static int npcm_pspi_probe(struct platform_device *pdev)
 
 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);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-03 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01 14:10 [PATCH] spi: npcm-pspi: Fix wrong priv pointer Axel Lin
2019-01-03 13:53 ` Applied "spi: npcm-pspi: Fix wrong priv pointer" to the spi tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.