linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] spi: mediatek: move devm_spi_register_master position
@ 2021-07-13 11:42 Mason Zhang
  2021-07-14 15:55 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Mason Zhang @ 2021-07-13 11:42 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger
  Cc: linux-spi, linux-arm-kernel, linux-mediatek, linux-kernel,
	leilk.liu, wsd_upstream, Mason Zhang

From: Mason Zhang <Mason.Zhang@mediatek.com>

This patch move devm_spi_register_master to the end of mtk_spi_probe.
If slaves call spi_sync in there probe function, master should have probe done.

Signed-off-by: Mason Zhang <Mason.Zhang@mediatek.com>
---
 drivers/spi/spi-mt65xx.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index b34fbc913fd6..6f2925118b98 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -820,12 +820,6 @@ static int mtk_spi_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(&pdev->dev);
 
-	ret = devm_spi_register_master(&pdev->dev, master);
-	if (ret) {
-		dev_err(&pdev->dev, "failed to register master (%d)\n", ret);
-		goto err_disable_runtime_pm;
-	}
-
 	if (mdata->dev_comp->need_pad_sel) {
 		if (mdata->pad_num != master->num_chipselect) {
 			dev_err(&pdev->dev,
@@ -865,6 +859,12 @@ static int mtk_spi_probe(struct platform_device *pdev)
 		dev_notice(&pdev->dev, "SPI dma_set_mask(%d) failed, ret:%d\n",
 			   addr_bits, ret);
 
+	ret = devm_spi_register_master(&pdev->dev, master);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to register master (%d)\n", ret);
+		goto err_disable_runtime_pm;
+	}
+
 	return 0;
 
 err_disable_runtime_pm:
-- 
2.18.0


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

* Re: [PATCH 2/2] spi: mediatek: move devm_spi_register_master position
  2021-07-13 11:42 [PATCH 2/2] spi: mediatek: move devm_spi_register_master position Mason Zhang
@ 2021-07-14 15:55 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-07-14 15:55 UTC (permalink / raw)
  To: Mason Zhang, Matthias Brugger
  Cc: Mark Brown, wsd_upstream, linux-arm-kernel, linux-mediatek,
	leilk.liu, Mason Zhang, linux-spi, linux-kernel

On Tue, 13 Jul 2021 19:42:48 +0800, Mason Zhang wrote:
> This patch move devm_spi_register_master to the end of mtk_spi_probe.
> If slaves call spi_sync in there probe function, master should have probe done.

Applied to

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

Thanks!

[2/2] spi: mediatek: move devm_spi_register_master position
      commit: c934fec1c32840224fd975544c347823962193b2

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] 2+ messages in thread

end of thread, other threads:[~2021-07-14 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 11:42 [PATCH 2/2] spi: mediatek: move devm_spi_register_master position Mason Zhang
2021-07-14 15:55 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).