[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210103035415.23600-1-tiny.windzz@gmail.com>
Date: Sun, 3 Jan 2021 03:54:15 +0000
From: Yangtao Li <tiny.windzz@...il.com>
To: myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
cw00.choi@...sung.com, krzk@...nel.org, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
linux-imx@....com, digetx@...il.com, thierry.reding@...il.com,
jonathanh@...dia.com, yuq825@...il.com, airlied@...ux.ie,
daniel@...ll.ch, robdclark@...il.com, sean@...rly.run,
robh@...nel.org, tomeu.vizoso@...labora.com, steven.price@....com,
alyssa.rosenzweig@...labora.com, stanimir.varbanov@...aro.org,
agross@...nel.org, bjorn.andersson@...aro.org, mchehab@...nel.org,
lukasz.luba@....com, adrian.hunter@...el.com,
ulf.hansson@...aro.org, vireshk@...nel.org, nm@...com,
sboyd@...nel.org, broonie@...nel.org, gregkh@...uxfoundation.org,
jirislaby@...nel.org, rjw@...ysocki.net, jcrouse@...eaurora.org,
hoegsberg@...gle.com, eric@...olt.net, tzimmermann@...e.de,
marijn.suijten@...ainline.org, gustavoars@...nel.org,
emil.velikov@...labora.com, jonathan@...ek.ca,
akhilpo@...eaurora.org, smasetty@...eaurora.org,
airlied@...hat.com, masneyb@...tation.org, kalyan_t@...eaurora.org,
tanmay@...eaurora.org, tiny.windzz@...il.com,
ddavenport@...omium.org, jsanka@...eaurora.org,
rnayak@...eaurora.org, tongtiangen@...wei.com,
miaoqinglang@...wei.com, khsieh@...eaurora.org,
abhinavk@...eaurora.org, chandanu@...eaurora.org,
groeck@...omium.org, varar@...eaurora.org, mka@...omium.org,
harigovi@...eaurora.org, rikard.falkeborn@...il.com,
natechancellor@...il.com, georgi.djakov@...aro.org,
akashast@...eaurora.org, parashar@...eaurora.org,
dianders@...omium.org
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
dri-devel@...ts.freedesktop.org, lima@...ts.freedesktop.org,
linux-arm-msm@...r.kernel.org, freedreno@...ts.freedesktop.org,
linux-media@...r.kernel.org, linux-mmc@...r.kernel.org,
linux-spi@...r.kernel.org, linux-serial@...r.kernel.org
Subject: [PATCH 25/31] memory: tegra30: convert to use devm_pm_opp_* API
Use devm_pm_opp_* API to simplify code.
Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
drivers/memory/tegra/tegra30-emc.c | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c
index 44ac155936aa..a93d8c3629fe 100644
--- a/drivers/memory/tegra/tegra30-emc.c
+++ b/drivers/memory/tegra/tegra30-emc.c
@@ -1483,31 +1483,31 @@ static int tegra_emc_interconnect_init(struct tegra_emc *emc)
static int tegra_emc_opp_table_init(struct tegra_emc *emc)
{
u32 hw_version = BIT(tegra_sku_info.soc_speedo_id);
- struct opp_table *clk_opp_table, *hw_opp_table;
+ struct opp_table *opp_table;
int err;
- clk_opp_table = dev_pm_opp_set_clkname(emc->dev, NULL);
- err = PTR_ERR_OR_ZERO(clk_opp_table);
+ opp_table = devm_pm_opp_set_clkname(emc->dev, NULL);
+ err = PTR_ERR_OR_ZERO(opp_table);
if (err) {
dev_err(emc->dev, "failed to set OPP clk: %d\n", err);
return err;
}
- hw_opp_table = dev_pm_opp_set_supported_hw(emc->dev, &hw_version, 1);
- err = PTR_ERR_OR_ZERO(hw_opp_table);
+ opp_table = devm_pm_opp_set_supported_hw(emc->dev, &hw_version, 1);
+ err = PTR_ERR_OR_ZERO(opp_table);
if (err) {
dev_err(emc->dev, "failed to set OPP supported HW: %d\n", err);
- goto put_clk_table;
+ return err;
}
- err = dev_pm_opp_of_add_table(emc->dev);
+ err = devm_pm_opp_of_add_table(emc->dev);
if (err) {
if (err == -ENODEV)
dev_err(emc->dev, "OPP table not found, please update your device tree\n");
else
dev_err(emc->dev, "failed to add OPP table: %d\n", err);
- goto put_hw_table;
+ return err;
}
dev_info(emc->dev, "OPP HW ver. 0x%x, current clock rate %lu MHz\n",
@@ -1515,19 +1515,8 @@ static int tegra_emc_opp_table_init(struct tegra_emc *emc)
/* first dummy rate-set initializes voltage state */
err = dev_pm_opp_set_rate(emc->dev, clk_get_rate(emc->clk));
- if (err) {
+ if (err)
dev_err(emc->dev, "failed to initialize OPP clock: %d\n", err);
- goto remove_table;
- }
-
- return 0;
-
-remove_table:
- dev_pm_opp_of_remove_table(emc->dev);
-put_hw_table:
- dev_pm_opp_put_supported_hw(hw_opp_table);
-put_clk_table:
- dev_pm_opp_put_clkname(clk_opp_table);
return err;
}
--
2.25.1
Powered by blists - more mailing lists