Skip to contentSkip to conversation

memory: tegra186-emc: Fix missing put_bpmp

PATCH Superseded Jon Hunter 1 participant 2 messages Nov 6, 2025

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH 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()")
---
 drivers/memory/tegra/tegra186-emc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/memory/tegra/tegra186-emc.c +5 -3
index 74be09968baa..2c3377ea7fa4 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: %d\n");
+		goto put_bpmp;
+	}
 
 	platform_set_drvdata(pdev, emc);
 	emc->dev = &pdev->dev;
Signature · 1 line
2.43.0
author maintainer
#1 lore raw
Quoted 16 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()")
---
  drivers/memory/tegra/tegra186-emc.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/memory/tegra/tegra186-emc.c +0 -0
index 74be09968baa..2c3377ea7fa4 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: %d\n");

Ugh this is wrong. Will send a V2 shortly ...

Jon

Signature · 1 line
nvpublic