All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: uniphier: Fix a bug that doesn't point to private data correctly
@ 2021-12-22  4:48 ` Kunihiko Hayashi
  0 siblings, 0 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2021-12-22  4:48 UTC (permalink / raw)
  To: Mark Brown
  Cc: Masami Hiramatsu, Keiji Hayashibara, linux-spi, linux-arm-kernel,
	linux-kernel, Kunihiko Hayashi, stable

In uniphier_spi_remove(), there is a wrong code to get private data from
the platform device, so the driver can't be removed properly.

The driver should get spi_master from the platform device and retrieve
the private data from it.

Cc: <stable@vger.kernel.org>
Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/spi/spi-uniphier.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index 8900e51e1a1c..342ee8d2c476 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -767,12 +767,13 @@ static int uniphier_spi_probe(struct platform_device *pdev)
 
 static int uniphier_spi_remove(struct platform_device *pdev)
 {
-	struct uniphier_spi_priv *priv = platform_get_drvdata(pdev);
+	struct spi_master *master = platform_get_drvdata(pdev);
+	struct uniphier_spi_priv *priv = spi_master_get_devdata(master);
 
-	if (priv->master->dma_tx)
-		dma_release_channel(priv->master->dma_tx);
-	if (priv->master->dma_rx)
-		dma_release_channel(priv->master->dma_rx);
+	if (master->dma_tx)
+		dma_release_channel(master->dma_tx);
+	if (master->dma_rx)
+		dma_release_channel(master->dma_rx);
 
 	clk_disable_unprepare(priv->clk);
 
-- 
2.7.4


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

* [PATCH] spi: uniphier: Fix a bug that doesn't point to private data correctly
@ 2021-12-22  4:48 ` Kunihiko Hayashi
  0 siblings, 0 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2021-12-22  4:48 UTC (permalink / raw)
  To: Mark Brown
  Cc: Masami Hiramatsu, Keiji Hayashibara, linux-spi, linux-arm-kernel,
	linux-kernel, Kunihiko Hayashi, stable

In uniphier_spi_remove(), there is a wrong code to get private data from
the platform device, so the driver can't be removed properly.

The driver should get spi_master from the platform device and retrieve
the private data from it.

Cc: <stable@vger.kernel.org>
Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/spi/spi-uniphier.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index 8900e51e1a1c..342ee8d2c476 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -767,12 +767,13 @@ static int uniphier_spi_probe(struct platform_device *pdev)
 
 static int uniphier_spi_remove(struct platform_device *pdev)
 {
-	struct uniphier_spi_priv *priv = platform_get_drvdata(pdev);
+	struct spi_master *master = platform_get_drvdata(pdev);
+	struct uniphier_spi_priv *priv = spi_master_get_devdata(master);
 
-	if (priv->master->dma_tx)
-		dma_release_channel(priv->master->dma_tx);
-	if (priv->master->dma_rx)
-		dma_release_channel(priv->master->dma_rx);
+	if (master->dma_tx)
+		dma_release_channel(master->dma_tx);
+	if (master->dma_rx)
+		dma_release_channel(master->dma_rx);
 
 	clk_disable_unprepare(priv->clk);
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] spi: uniphier: Fix a bug that doesn't point to private data correctly
  2021-12-22  4:48 ` Kunihiko Hayashi
@ 2021-12-22 14:04   ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-12-22 14:04 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: stable, linux-arm-kernel, linux-kernel, Masami Hiramatsu,
	linux-spi, Keiji Hayashibara

On Wed, 22 Dec 2021 13:48:12 +0900, Kunihiko Hayashi wrote:
> In uniphier_spi_remove(), there is a wrong code to get private data from
> the platform device, so the driver can't be removed properly.
> 
> The driver should get spi_master from the platform device and retrieve
> the private data from it.
> 
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: uniphier: Fix a bug that doesn't point to private data correctly
      commit: 80bb73a9fbcde4ecc55e12f10c73fabbe68a24d1

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

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

* Re: [PATCH] spi: uniphier: Fix a bug that doesn't point to private data correctly
@ 2021-12-22 14:04   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-12-22 14:04 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: stable, linux-arm-kernel, linux-kernel, Masami Hiramatsu,
	linux-spi, Keiji Hayashibara

On Wed, 22 Dec 2021 13:48:12 +0900, Kunihiko Hayashi wrote:
> In uniphier_spi_remove(), there is a wrong code to get private data from
> the platform device, so the driver can't be removed properly.
> 
> The driver should get spi_master from the platform device and retrieve
> the private data from it.
> 
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: uniphier: Fix a bug that doesn't point to private data correctly
      commit: 80bb73a9fbcde4ecc55e12f10c73fabbe68a24d1

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] spi: uniphier: Fix a bug that doesn't point to private data correctly
  2021-12-22  4:48 ` Kunihiko Hayashi
@ 2022-01-26 15:36   ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-01-26 15:36 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: linux-spi, Keiji Hayashibara, linux-kernel, Masami Hiramatsu,
	linux-arm-kernel, stable

On Wed, 22 Dec 2021 13:48:12 +0900, Kunihiko Hayashi wrote:
> In uniphier_spi_remove(), there is a wrong code to get private data from
> the platform device, so the driver can't be removed properly.
> 
> The driver should get spi_master from the platform device and retrieve
> the private data from it.
> 
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: uniphier: Fix a bug that doesn't point to private data correctly
      commit: 23e3404de1aecc62c14ac96d4b63403c3e0f52d5

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

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

* Re: [PATCH] spi: uniphier: Fix a bug that doesn't point to private data correctly
@ 2022-01-26 15:36   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-01-26 15:36 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: linux-spi, Keiji Hayashibara, linux-kernel, Masami Hiramatsu,
	linux-arm-kernel, stable

On Wed, 22 Dec 2021 13:48:12 +0900, Kunihiko Hayashi wrote:
> In uniphier_spi_remove(), there is a wrong code to get private data from
> the platform device, so the driver can't be removed properly.
> 
> The driver should get spi_master from the platform device and retrieve
> the private data from it.
> 
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: uniphier: Fix a bug that doesn't point to private data correctly
      commit: 23e3404de1aecc62c14ac96d4b63403c3e0f52d5

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-01-26 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22  4:48 [PATCH] spi: uniphier: Fix a bug that doesn't point to private data correctly Kunihiko Hayashi
2021-12-22  4:48 ` Kunihiko Hayashi
2021-12-22 14:04 ` Mark Brown
2021-12-22 14:04   ` Mark Brown
2022-01-26 15:36 ` Mark Brown
2022-01-26 15:36   ` 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.