diff mbox series

[5/7] drm/lima: dev_pm_opp_put_*() accepts NULL argument

Message ID 2518c14df2f16cc3c4fee35499895a32513c174b.1604646059.git.viresh.kumar@linaro.org
State Accepted
Commit 72ba9e226fac8a9958b5201428a387c348515289
Headers show
Series opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table | expand

Commit Message

Viresh Kumar Nov. 6, 2020, 7:03 a.m. UTC
The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
there is no need for us to carry the extra check. Drop them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

---
 drivers/gpu/drm/lima/lima_devfreq.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

-- 
2.25.0.rc1.19.g042ed3e048af

Comments

Qiang Yu Nov. 16, 2020, 12:42 a.m. UTC | #1
Looks good for me, patch is:
Reviewed-by: Qiang Yu <yuq825@gmail.com>


Regards,
Qiang

On Fri, Nov 6, 2020 at 3:05 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>

> The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so

> there is no need for us to carry the extra check. Drop them.

>

> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

> ---

>  drivers/gpu/drm/lima/lima_devfreq.c | 13 ++++---------

>  1 file changed, 4 insertions(+), 9 deletions(-)

>

> diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c

> index bbe02817721b..e7b7b8dfd792 100644

> --- a/drivers/gpu/drm/lima/lima_devfreq.c

> +++ b/drivers/gpu/drm/lima/lima_devfreq.c

> @@ -110,15 +110,10 @@ void lima_devfreq_fini(struct lima_device *ldev)

>                 devfreq->opp_of_table_added = false;

>         }

>

> -       if (devfreq->regulators_opp_table) {

> -               dev_pm_opp_put_regulators(devfreq->regulators_opp_table);

> -               devfreq->regulators_opp_table = NULL;

> -       }

> -

> -       if (devfreq->clkname_opp_table) {

> -               dev_pm_opp_put_clkname(devfreq->clkname_opp_table);

> -               devfreq->clkname_opp_table = NULL;

> -       }

> +       dev_pm_opp_put_regulators(devfreq->regulators_opp_table);

> +       dev_pm_opp_put_clkname(devfreq->clkname_opp_table);

> +       devfreq->regulators_opp_table = NULL;

> +       devfreq->clkname_opp_table = NULL;

>  }

>

>  int lima_devfreq_init(struct lima_device *ldev)

> --

> 2.25.0.rc1.19.g042ed3e048af

>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/lima/lima_devfreq.c b/drivers/gpu/drm/lima/lima_devfreq.c
index bbe02817721b..e7b7b8dfd792 100644
--- a/drivers/gpu/drm/lima/lima_devfreq.c
+++ b/drivers/gpu/drm/lima/lima_devfreq.c
@@ -110,15 +110,10 @@  void lima_devfreq_fini(struct lima_device *ldev)
 		devfreq->opp_of_table_added = false;
 	}
 
-	if (devfreq->regulators_opp_table) {
-		dev_pm_opp_put_regulators(devfreq->regulators_opp_table);
-		devfreq->regulators_opp_table = NULL;
-	}
-
-	if (devfreq->clkname_opp_table) {
-		dev_pm_opp_put_clkname(devfreq->clkname_opp_table);
-		devfreq->clkname_opp_table = NULL;
-	}
+	dev_pm_opp_put_regulators(devfreq->regulators_opp_table);
+	dev_pm_opp_put_clkname(devfreq->clkname_opp_table);
+	devfreq->regulators_opp_table = NULL;
+	devfreq->clkname_opp_table = NULL;
 }
 
 int lima_devfreq_init(struct lima_device *ldev)