Re: [PATCH 26/31] PM / devfreq: tegra30: convert to use devm_pm_opp_* API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH 26/31] PM / devfreq: tegra30: convert to use devm_pm_opp_* API
- From: Chanwoo Choi <cwchoi00@xxxxxxxxx>
- Date: Tue, 5 Jan 2021 12:47:16 +0900
- Cc: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>, Kyungmin Park <kyungmin.park@xxxxxxxxxxx>, Chanwoo Choi <cw00.choi@xxxxxxxxxxx>, Krzysztof Kozlowski <krzk@xxxxxxxxxx>, Shawn Guo <shawnguo@xxxxxxxxxx>, s.hauer@xxxxxxxxxxxxxx, kernel@xxxxxxxxxxxxxx, festevam@xxxxxxxxx, dl-linux-imx <linux-imx@xxxxxxx>, Dmitry Osipenko <digetx@xxxxxxxxx>, Thierry Reding <thierry.reding@xxxxxxxxx>, Jonathan Hunter <jonathanh@xxxxxxxxxx>, yuq825@xxxxxxxxx, David Airlie <airlied@xxxxxxxx>, daniel@xxxxxxxx, robdclark@xxxxxxxxx, sean@xxxxxxxxxx, Rob Herring <robh@xxxxxxxxxx>, tomeu.vizoso@xxxxxxxxxxxxx, steven.price@xxxxxxx, alyssa.rosenzweig@xxxxxxxxxxxxx, stanimir.varbanov@xxxxxxxxxx, agross@xxxxxxxxxx, Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>, mchehab@xxxxxxxxxx, Lukasz Luba <lukasz.luba@xxxxxxx>, adrian.hunter@xxxxxxxxx, Ulf Hansson <ulf.hansson@xxxxxxxxxx>, Viresh Kumar <vireshk@xxxxxxxxxx>, Nishanth Menon <nm@xxxxxx>, Stephen Boyd <sboyd@xxxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>, jirislaby@xxxxxxxxxx, "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>, jcrouse@xxxxxxxxxxxxxx, hoegsberg@xxxxxxxxxx, eric@xxxxxxxxxxxxxxxxxx, tzimmermann@xxxxxxx, marijn.suijten@xxxxxxxxxxxxxx, gustavoars@xxxxxxxxxx, emil.velikov@xxxxxxxxxxxxx, jonathan@xxxxxxxx, akhilpo@xxxxxxxxxxxxxx, smasetty@xxxxxxxxxxxxxx, airlied@xxxxxxxxxx, masneyb@xxxxxxxxxxxxx, kalyan_t@xxxxxxxxxxxxxx, tanmay@xxxxxxxxxxxxxx, ddavenport@xxxxxxxxxxxx, jsanka@xxxxxxxxxxxxxx, rnayak@xxxxxxxxxxxxxx, tongtiangen@xxxxxxxxxx, miaoqinglang@xxxxxxxxxx, khsieh@xxxxxxxxxxxxxx, abhinavk@xxxxxxxxxxxxxx, chandanu@xxxxxxxxxxxxxx, Guenter Roeck <groeck@xxxxxxxxxxxx>, varar@xxxxxxxxxxxxxx, Matthias Kaehlcke <mka@xxxxxxxxxxxx>, harigovi@xxxxxxxxxxxxxx, rikard.falkeborn@xxxxxxxxx, natechancellor@xxxxxxxxx, Georgi Djakov <georgi.djakov@xxxxxxxxxx>, akashast@xxxxxxxxxxxxxx, parashar@xxxxxxxxxxxxxx, Doug Anderson <dianders@xxxxxxxxxxxx>, Linux PM list <linux-pm@xxxxxxxxxxxxxxx>, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, linux-samsung-soc <linux-samsung-soc@xxxxxxxxxxxxxxx>, linux-arm-kernel <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-tegra@xxxxxxxxxxxxxxx, dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, lima@xxxxxxxxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, freedreno@xxxxxxxxxxxxxxxxxxxxx, linux-media@xxxxxxxxxxxxxxx, linux-mmc@xxxxxxxxxxxxxxx, linux-spi@xxxxxxxxxxxxxxx, linux-serial@xxxxxxxxxxxxxxx
- In-reply-to: <20210103035445.23696-1-tiny.windzz@gmail.com>
- References: <20210103035445.23696-1-tiny.windzz@gmail.com>
- Reply-to: cwchoi00@xxxxxxxxx
Hi,
On Sun, Jan 3, 2021 at 12:57 PM Yangtao Li <tiny.windzz@xxxxxxxxx> wrote:
>
> Use devm_pm_opp_* API to simplify code, and remove opp_table
> from tegra_devfreq.
>
> Signed-off-by: Yangtao Li <tiny.windzz@xxxxxxxxx>
> ---
> 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
[Index of Archives]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|