Skip to content

Commit c934fec

Browse files
Mason Zhangbroonie
authored andcommitted
spi: mediatek: move devm_spi_register_master position
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3a70dd2 commit c934fec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/spi/spi-mt65xx.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,6 @@ static int mtk_spi_probe(struct platform_device *pdev)
803803

804804
pm_runtime_enable(&pdev->dev);
805805

806-
ret = devm_spi_register_master(&pdev->dev, master);
807-
if (ret) {
808-
dev_err(&pdev->dev, "failed to register master (%d)\n", ret);
809-
goto err_disable_runtime_pm;
810-
}
811-
812806
if (mdata->dev_comp->need_pad_sel) {
813807
if (mdata->pad_num != master->num_chipselect) {
814808
dev_err(&pdev->dev,
@@ -848,6 +842,12 @@ static int mtk_spi_probe(struct platform_device *pdev)
848842
dev_notice(&pdev->dev, "SPI dma_set_mask(%d) failed, ret:%d\n",
849843
addr_bits, ret);
850844

845+
ret = devm_spi_register_master(&pdev->dev, master);
846+
if (ret) {
847+
dev_err(&pdev->dev, "failed to register master (%d)\n", ret);
848+
goto err_disable_runtime_pm;
849+
}
850+
851851
return 0;
852852

853853
err_disable_runtime_pm:

0 commit comments

Comments
 (0)