* [PATCH next] memory: tegra210-emc: Fix error codes in tegra210_emc_opp_table_init()
@ 2025-11-21 13:36 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2025-11-21 13:36 UTC (permalink / raw)
To: Aaron Kling
Cc: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter, Ingo Molnar,
Thomas Gleixner, Dan Carpenter, linux-kernel, linux-tegra,
kernel-janitors
Fix several error paths where the error code was not set correctly.
Fixes: b33c93babead ("memory: tegra210: Support interconnect framework")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/memory/tegra/tegra210-emc-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegra/tegra210-emc-core.c
index 397448cb472d..c97ce799d53d 100644
--- a/drivers/memory/tegra/tegra210-emc-core.c
+++ b/drivers/memory/tegra/tegra210-emc-core.c
@@ -1981,11 +1981,13 @@ static int tegra210_emc_opp_table_init(struct tegra210_emc *emc)
max_opps = dev_pm_opp_get_opp_count(emc->dev);
if (max_opps <= 0) {
+ err = max_opps ?: -EINVAL;
dev_err_probe(emc->dev, err, "Failed to add OPPs\n");
goto remove_table;
}
if (emc->num_timings != max_opps) {
+ err = -EINVAL;
dev_err_probe(emc->dev, err, "OPP table does not match emc table\n");
goto remove_table;
}
@@ -1994,6 +1996,7 @@ static int tegra210_emc_opp_table_init(struct tegra210_emc *emc)
rate = emc->timings[i].rate * 1000;
opp = dev_pm_opp_find_freq_exact(emc->dev, rate, true);
if (IS_ERR(opp)) {
+ err = PTR_ERR(opp);
dev_err_probe(emc->dev, err, "Rate %lu not found in OPP table\n", rate);
goto remove_table;
}
--
2.51.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-21 13:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 13:36 [PATCH next] memory: tegra210-emc: Fix error codes in tegra210_emc_opp_table_init() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox