* [PATCH] memory: tegra186-emc: Fix missing put_bpmp
@ 2025-11-06 17:26 Jon Hunter
2025-11-06 17:28 ` Jon Hunter
0 siblings, 1 reply; 2+ messages in thread
From: Jon Hunter @ 2025-11-06 17:26 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thierry Reding; +Cc: linux-tegra, 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()")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
drivers/memory/tegra/tegra186-emc.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c
index 74be09968baa..2c3377ea7fa4 100644
--- a/drivers/memory/tegra/tegra186-emc.c
+++ b/drivers/memory/tegra/tegra186-emc.c
@@ -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;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] memory: tegra186-emc: Fix missing put_bpmp
2025-11-06 17:26 [PATCH] memory: tegra186-emc: Fix missing put_bpmp Jon Hunter
@ 2025-11-06 17:28 ` Jon Hunter
0 siblings, 0 replies; 2+ messages in thread
From: Jon Hunter @ 2025-11-06 17:28 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thierry Reding; +Cc: linux-tegra
On 06/11/2025 17:26, Jon Hunter wrote:
> 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()")
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> drivers/memory/tegra/tegra186-emc.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/memory/tegra/tegra186-emc.c b/drivers/memory/tegra/tegra186-emc.c
> index 74be09968baa..2c3377ea7fa4 100644
> --- a/drivers/memory/tegra/tegra186-emc.c
> +++ b/drivers/memory/tegra/tegra186-emc.c
> @@ -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
--
nvpublic
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-06 17:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 17:26 [PATCH] memory: tegra186-emc: Fix missing put_bpmp Jon Hunter
2025-11-06 17:28 ` Jon Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox