Commit 5637abaa authored by Michael Tretter's avatar Michael Tretter Committed by Vinod Koul

dmaengine: zynqmp_dma: simplify with dev_err_probe

The clocks are provided by the ZynqMP firmware driver and are deferred
until the firmware driver has probed. This leads to misleading error
messages during probe of the zynqmp_dma driver.

Use dev_err_probe for printing errors during probe to avoid error
messages for -EPROBE_DEFER.
Signed-off-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
Link: https://lore.kernel.org/r/20210826094742.1302009-2-m.tretter@pengutronix.deSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 6880fa6c
...@@ -1061,16 +1061,14 @@ static int zynqmp_dma_probe(struct platform_device *pdev) ...@@ -1061,16 +1061,14 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
p->dev = &pdev->dev; p->dev = &pdev->dev;
zdev->clk_main = devm_clk_get(&pdev->dev, "clk_main"); zdev->clk_main = devm_clk_get(&pdev->dev, "clk_main");
if (IS_ERR(zdev->clk_main)) { if (IS_ERR(zdev->clk_main))
dev_err(&pdev->dev, "main clock not found.\n"); return dev_err_probe(&pdev->dev, PTR_ERR(zdev->clk_main),
return PTR_ERR(zdev->clk_main); "main clock not found.\n");
}
zdev->clk_apb = devm_clk_get(&pdev->dev, "clk_apb"); zdev->clk_apb = devm_clk_get(&pdev->dev, "clk_apb");
if (IS_ERR(zdev->clk_apb)) { if (IS_ERR(zdev->clk_apb))
dev_err(&pdev->dev, "apb clock not found.\n"); return dev_err_probe(&pdev->dev, PTR_ERR(zdev->clk_apb),
return PTR_ERR(zdev->clk_apb); "apb clock not found.\n");
}
platform_set_drvdata(pdev, zdev); platform_set_drvdata(pdev, zdev);
pm_runtime_set_autosuspend_delay(zdev->dev, ZDMA_PM_TIMEOUT); pm_runtime_set_autosuspend_delay(zdev->dev, ZDMA_PM_TIMEOUT);
...@@ -1085,7 +1083,7 @@ static int zynqmp_dma_probe(struct platform_device *pdev) ...@@ -1085,7 +1083,7 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
ret = zynqmp_dma_chan_probe(zdev, pdev); ret = zynqmp_dma_chan_probe(zdev, pdev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Probing channel failed\n"); dev_err_probe(&pdev->dev, ret, "Probing channel failed\n");
goto err_disable_pm; goto err_disable_pm;
} }
...@@ -1097,7 +1095,7 @@ static int zynqmp_dma_probe(struct platform_device *pdev) ...@@ -1097,7 +1095,7 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
ret = of_dma_controller_register(pdev->dev.of_node, ret = of_dma_controller_register(pdev->dev.of_node,
of_zynqmp_dma_xlate, zdev); of_zynqmp_dma_xlate, zdev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Unable to register DMA to DT\n"); dev_err_probe(&pdev->dev, ret, "Unable to register DMA to DT\n");
dma_async_device_unregister(&zdev->common); dma_async_device_unregister(&zdev->common);
goto free_chan_resources; goto free_chan_resources;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment