[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210103035445.23696-1-tiny.windzz@gmail.com>
Date: Sun, 3 Jan 2021 03:54:45 +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 26/31] PM / devfreq: tegra30: convert to use devm_pm_opp_* API
Use devm_pm_opp_* API to simplify code, and remove opp_table
from tegra_devfreq.
Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
drivers/devfreq/tegra30-devfreq.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c
index 117cad7968ab..4984cb91e9ea 100644
--- a/drivers/devfreq/tegra30-devfreq.c
+++ b/drivers/devfreq/tegra30-devfreq.c
@@ -178,7 +178,6 @@ struct tegra_devfreq_soc_data {
struct tegra_devfreq {
struct devfreq *devfreq;
- struct opp_table *opp_table;
struct reset_control *reset;
struct clk *clock;
@@ -794,6 +793,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
struct tegra_devfreq_device *dev;
struct tegra_devfreq *tegra;
struct devfreq *devfreq;
+ struct opp_tabl *opp_table;
unsigned int i;
long rate;
int err;
@@ -841,25 +841,25 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
return err;
}
- tegra->opp_table = dev_pm_opp_set_supported_hw(&pdev->dev,
- &hw_version, 1);
- err = PTR_ERR_OR_ZERO(tegra->opp_table);
+ opp_table = devm_pm_opp_set_supported_hw(&pdev->dev,
+ &hw_version, 1);
+ err = PTR_ERR_OR_ZERO(opp_table);
if (err) {
dev_err(&pdev->dev, "Failed to set supported HW: %d\n", err);
return err;
}
- err = dev_pm_opp_of_add_table(&pdev->dev);
+ err = devm_pm_opp_of_add_table(&pdev->dev);
if (err) {
dev_err(&pdev->dev, "Failed to add OPP table: %d\n", err);
- goto put_hw;
+ return err;
}
err = clk_prepare_enable(tegra->clock);
if (err) {
dev_err(&pdev->dev,
"Failed to prepare and enable ACTMON clock\n");
- goto remove_table;
+ return err;
}
err = reset_control_reset(tegra->reset);
@@ -917,10 +917,6 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
reset_control_reset(tegra->reset);
disable_clk:
clk_disable_unprepare(tegra->clock);
-remove_table:
- dev_pm_opp_of_remove_table(&pdev->dev);
-put_hw:
- dev_pm_opp_put_supported_hw(tegra->opp_table);
return err;
}
@@ -935,9 +931,6 @@ static int tegra_devfreq_remove(struct platform_device *pdev)
reset_control_reset(tegra->reset);
clk_disable_unprepare(tegra->clock);
- dev_pm_opp_of_remove_table(&pdev->dev);
- dev_pm_opp_put_supported_hw(tegra->opp_table);
-
return 0;
}
--
2.25.1
Powered by blists - more mailing lists