memory: tegra186-emc: Fix missing put_bpmp
Subsystems (2)
Jon Hunter
maintainerPATCH v2 1/1 memory: tegra186-emc: Fix missing put_bpmp
Commit a52ddb98a674 ("memory: tegra186-emc: Simplify and handle deferred probe with dev_err_probe()") accidently dropped a call to 'put_bpmp' to release a handle to the BPMP when getting the EMC clock fails. Fix this by restoring the 'goto put_bpmp' if devm_clk_get() fails.
---
Changes since V1:
- Fixed dev_err_probe message format
Please note that the commit hash reference is based upon the hash in the -next tree.
drivers/memory/tegra/tegra186-emc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/memory/tegra/tegra186-emc.c +5 -3
@@ -448,9 +448,11 @@ static int tegra186_emc_probe(struct platform_device *pdev) "failed to get BPMP\n"); emc->clk =devm_clk_get (&pdev->dev,"emc" ); -if (IS_ERR (emc->clk)) -return dev_err_probe (&pdev->dev,PTR_ERR (emc->clk), -"failed to get EMC clock\n" ); +if (IS_ERR (emc->clk)) { + err =PTR_ERR (emc->clk); +dev_err_probe (&pdev->dev, err,"failed to get EMC clock\n" ); + goto put_bpmp; + }platform_set_drvdata (pdev, emc); emc->dev = &pdev->dev;
Signature · 1 line
2.43.0
Krzysztof Kozlowski
maintainerQuoted 22 lines · Jon Hunter
Commit
a52ddb98a674("memory: tegra186-emc: Simplify and handle deferred probe withdev_err_probe()") accidently dropped a call to 'put_bpmp' to release a handle to the BPMP when getting the EMC clock fails. Fix this by restoring the 'gotoput_bpmp' ifdevm_clk_get()fails.Fixes a52ddb98a674 ("memory: tegra186-emc: Simplify and handle deferred probe with dev_err_probe()")Signed-off-by Jon Hunter <[email protected]>---
Changes since V1:
- Fixeddev_err_probemessage formatPlease note that the commit hash reference is based upon the hash in the -next tree.
drivers/memory/tegra/tegra186-emc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/memory/tegra/tegra186-emc.c +0
-0
drivers/memory/tegra/tegra186-emc.c static int tegra186_emc_probe(struct platform_device *pdev) · line 453
Quoted 9 lines
drivers/memory/tegra/tegra186-emc.c +3
-3@@ -448,9 +448,11 @@ static int tegra186_emc_probe(struct platform_device *pdev) "failed to get BPMP\n"); emc->clk =devm_clk_get (&pdev->dev,"emc" ); -if (IS_ERR (emc->clk)) -return dev_err_probe (&pdev->dev,PTR_ERR (emc->clk), -"failed to get EMC clock\n" ); +if (IS_ERR (emc->clk)) { + err =PTR_ERR (emc->clk); +dev_err_probe (&pdev->dev, err,"failed to get EMC clock\n" );
This still should use standard dev_err_probe syntax, so:
err = dev_err_probe(..., PTR_ERR(), "....");
which saves you one line with earlier assignment.
Best regards,
Krzysztof
Jon Hunter
maintainerQuoted 35 lines · Krzysztof Kozlowski
Quoted 22 lines · Jon Hunter
Commit
a52ddb98a674("memory: tegra186-emc: Simplify and handle deferred probe withdev_err_probe()") accidently dropped a call to 'put_bpmp' to release a handle to the BPMP when getting the EMC clock fails. Fix this by restoring the 'gotoput_bpmp' ifdevm_clk_get()fails.Fixes a52ddb98a674 ("memory: tegra186-emc: Simplify and handle deferred probe with dev_err_probe()")Signed-off-by Jon Hunter <[email protected]>---
Changes since V1:
- Fixeddev_err_probemessage formatPlease note that the commit hash reference is based upon the hash in the -next tree.
drivers/memory/tegra/tegra186-emc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/memory/tegra/tegra186-emc.c +0
-0drivers/memory/tegra/tegra186-emc.c static int tegra186_emc_probe(struct platform_device *pdev) · line 453
Quoted 9 lines
drivers/memory/tegra/tegra186-emc.c +3
-3@@ -448,9 +448,11 @@ static int tegra186_emc_probe(struct platform_device *pdev) "failed to get BPMP\n"); emc->clk =devm_clk_get (&pdev->dev,"emc" ); -if (IS_ERR (emc->clk)) -return dev_err_probe (&pdev->dev,PTR_ERR (emc->clk), -"failed to get EMC clock\n" ); +if (IS_ERR (emc->clk)) { + err =PTR_ERR (emc->clk); +dev_err_probe (&pdev->dev, err,"failed to get EMC clock\n" );This still should use standard
dev_err_probesyntax, so:
Quoted 3 lines
err =
dev_err_probe(..., PTR_ERR(), "....");which saves you one line with earlier assignment.
Yes that is indeed better!
Jon
Signature · 1 line
nvpublic