[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGTfZH0sLh=8XhBVOzUr9qO2w_=jp-OuWoh5vgNpnmXq6EzYHA@mail.gmail.com>
Date: Tue, 5 Jan 2021 12:47:16 +0900
From: Chanwoo Choi <cwchoi00@...il.com>
To: Yangtao Li <tiny.windzz@...il.com>
Cc: MyungJoo Ham <myungjoo.ham@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Shawn Guo <shawnguo@...nel.org>, s.hauer@...gutronix.de,
kernel@...gutronix.de, festevam@...il.com,
dl-linux-imx <linux-imx@....com>,
Dmitry Osipenko <digetx@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>, yuq825@...il.com,
David Airlie <airlied@...ux.ie>, daniel@...ll.ch,
robdclark@...il.com, sean@...rly.run,
Rob Herring <robh@...nel.org>, tomeu.vizoso@...labora.com,
steven.price@....com, alyssa.rosenzweig@...labora.com,
stanimir.varbanov@...aro.org, agross@...nel.org,
Bjorn Andersson <bjorn.andersson@...aro.org>,
mchehab@...nel.org, Lukasz Luba <lukasz.luba@....com>,
adrian.hunter@...el.com, Ulf Hansson <ulf.hansson@...aro.org>,
Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>,
Mark Brown <broonie@...nel.org>,
Greg KH <gregkh@...uxfoundation.org>, jirislaby@...nel.org,
"Rafael J. Wysocki" <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, ddavenport@...omium.org,
jsanka@...eaurora.org, rnayak@...eaurora.org,
tongtiangen@...wei.com, miaoqinglang@...wei.com,
khsieh@...eaurora.org, abhinavk@...eaurora.org,
chandanu@...eaurora.org, Guenter Roeck <groeck@...omium.org>,
varar@...eaurora.org, Matthias Kaehlcke <mka@...omium.org>,
harigovi@...eaurora.org, rikard.falkeborn@...il.com,
natechancellor@...il.com, Georgi Djakov <georgi.djakov@...aro.org>,
akashast@...eaurora.org, parashar@...eaurora.org,
Doug Anderson <dianders@...omium.org>,
Linux PM list <linux-pm@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-samsung-soc <linux-samsung-soc@...r.kernel.org>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-tegra@...r.kernel.org,
dri-devel <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: Re: [PATCH 26/31] PM / devfreq: tegra30: convert to use devm_pm_opp_* API
Hi,
On Sun, Jan 3, 2021 at 12:57 PM Yangtao Li <tiny.windzz@...il.com> wrote:
>
> 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;
opp_tabl -> opp_table. It will make the build error. Please do build
test at least.
> 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);
You might remove the 'devm_pm_opp_remove_all_dynamic(&pdev->dev)
under ' remove_opp' goto statement.kkkk
(snip)
--
Best Regards,
Chanwoo Choi
Powered by blists - more mailing lists