Skip to contentSkip to conversation

memory: tegra186-emc: Fix missing put_bpmp

PATCH Superseded Jon Hunter 2 participants 3 messages Nov 6, 2025

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH 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.

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

---
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
index 74be09968baa..43595fd9c256 100644
@@ -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
#1 lore raw
Quoted 22 lines · Jon Hunter

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.

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

---
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 +0 -0
index 74be09968baa..43595fd9c256 100644

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

author maintainer
#2 lore raw
Quoted 35 lines · Krzysztof Kozlowski
Quoted 22 lines · Jon Hunter

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.

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

---
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 +0 -0
index 74be09968baa..43595fd9c256 100644

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:

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