memory: tegra186-emc: Simplify and handle deferred probe with dev_err_probe()

Certain calls, like clk_get, can cause probe deferral and driver should
handle it.  Use dev_err_probe() to fix that and also change other
non-deferred errors cases to make the code simpler.

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
Krzysztof Kozlowski 2025-09-11 11:43:19 +02:00
parent 57c9f6e29c
commit a52ddb98a6
1 changed files with 6 additions and 8 deletions

View File

@ -302,9 +302,8 @@ static int tegra_emc_interconnect_init(struct tegra186_emc *emc)
remove_nodes: remove_nodes:
icc_nodes_remove(&emc->provider); icc_nodes_remove(&emc->provider);
dev_err(emc->dev, "failed to initialize ICC: %d\n", err);
return err; return dev_err_probe(emc->dev, err, "failed to initialize ICC\n");
} }
static int tegra186_emc_probe(struct platform_device *pdev) static int tegra186_emc_probe(struct platform_device *pdev)
@ -319,14 +318,13 @@ static int tegra186_emc_probe(struct platform_device *pdev)
emc->bpmp = tegra_bpmp_get(&pdev->dev); emc->bpmp = tegra_bpmp_get(&pdev->dev);
if (IS_ERR(emc->bpmp)) if (IS_ERR(emc->bpmp))
return dev_err_probe(&pdev->dev, PTR_ERR(emc->bpmp), "failed to get BPMP\n"); return dev_err_probe(&pdev->dev, PTR_ERR(emc->bpmp),
"failed to get BPMP\n");
emc->clk = devm_clk_get(&pdev->dev, "emc"); emc->clk = devm_clk_get(&pdev->dev, "emc");
if (IS_ERR(emc->clk)) { if (IS_ERR(emc->clk))
err = PTR_ERR(emc->clk); return dev_err_probe(&pdev->dev, PTR_ERR(emc->clk),
dev_err(&pdev->dev, "failed to get EMC clock: %d\n", err); "failed to get EMC clock\n");
goto put_bpmp;
}
platform_set_drvdata(pdev, emc); platform_set_drvdata(pdev, emc);
emc->dev = &pdev->dev; emc->dev = &pdev->dev;