Re: [PATCH 27/31] PM / devfreq: rk3399_dmc: convert to use devm_pm_opp_* API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH 27/31] PM / devfreq: rk3399_dmc: convert to use devm_pm_opp_* API
- From: Chanwoo Choi <cwchoi00@xxxxxxxxx>
- Date: Tue, 5 Jan 2021 13:00:49 +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: <20210103035514.23788-1-tiny.windzz@gmail.com>
- References: <20210103035514.23788-1-tiny.windzz@gmail.com>
- Reply-to: cwchoi00@xxxxxxxxx
Hi,
Do you make this patch on latest source?
When I apply this patch for test, it make the merge conflict error.
On Sun, Jan 3, 2021 at 12:57 PM Yangtao Li <tiny.windzz@xxxxxxxxx> wrote:
>
> Use devm_pm_opp_* API to simplify code. Since devres release
> can guarantee the order, let's remove
> devm_devfreq_unregister_opp_notifier().
>
> Signed-off-by: Yangtao Li <tiny.windzz@xxxxxxxxx>
> ---
> drivers/devfreq/rk3399_dmc.c | 22 +++-------------------
> 1 file changed, 3 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> index 2e912166a993..9b8ab8be29d1 100644
> --- a/drivers/devfreq/rk3399_dmc.c
> +++ b/drivers/devfreq/rk3399_dmc.c
> @@ -432,7 +432,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
> * We add a devfreq driver to our parent since it has a device tree node
> * with operating points.
> */
> - if (dev_pm_opp_of_add_table(dev)) {
> + if (devm_pm_opp_of_add_table(dev)) {
> dev_err(dev, "Invalid operating-points in device tree.\n");
> ret = -EINVAL;
> goto err_edev;
> @@ -448,7 +448,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
> opp = devfreq_recommended_opp(dev, &data->rate, 0);
> if (IS_ERR(opp)) {
> ret = PTR_ERR(opp);
> - goto err_free_opp;
> + goto err_edev;
> }
>
> data->rate = dev_pm_opp_get_freq(opp);
> @@ -463,7 +463,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
> &data->ondemand_data);
> if (IS_ERR(data->devfreq)) {
> ret = PTR_ERR(data->devfreq);
> - goto err_free_opp;
> + goto err_edev;
> }
>
> devm_devfreq_register_opp_notifier(dev, data->devfreq);
> @@ -473,27 +473,12 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>
> return 0;
>
> -err_free_opp:
> - dev_pm_opp_of_remove_table(&pdev->dev);
> err_edev:
> devfreq_event_disable_edev(data->edev);
>
> return ret;
> }
>
> -static int rk3399_dmcfreq_remove(struct platform_device *pdev)
> -{
> - struct rk3399_dmcfreq *dmcfreq = dev_get_drvdata(&pdev->dev);
> -
> - /*
> - * Before remove the opp table we need to unregister the opp notifier.
> - */
> - devm_devfreq_unregister_opp_notifier(dmcfreq->dev, dmcfreq->devfreq);
> - dev_pm_opp_of_remove_table(dmcfreq->dev);
As the comment, we need to unregister the opp notifier before removing the OPP.
Do you guarantee this sequence on your patch?
> -
> - return 0;
> -}
> -
> static const struct of_device_id rk3399dmc_devfreq_of_match[] = {
> { .compatible = "rockchip,rk3399-dmc" },
> { },
> @@ -502,7 +487,6 @@ MODULE_DEVICE_TABLE(of, rk3399dmc_devfreq_of_match);
>
> static struct platform_driver rk3399_dmcfreq_driver = {
> .probe = rk3399_dmcfreq_probe,
> - .remove = rk3399_dmcfreq_remove,
> .driver = {
> .name = "rk3399-dmc-freq",
> .pm = &rk3399_dmcfreq_pm,
> --
> 2.25.1
>
--
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]
|