memory: tegra210-emc: Fix error codes in tegra210_emc_opp_table_init()
PATCH 1/1 memory: tegra210-emc: Fix error codes in tegra210_emc_opp_table_init()
Fix several error paths where the error code was not set correctly.
Fixes b33c93babead ("memory: tegra210: Support interconnect framework")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/memory/tegra/tegra210-emc-core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/memory/tegra/tegra210-emc-core.c +3 -0
@@ -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; }
Signature · 1 line
2.51.0