diff mbox series

[2/8] drm/lima: Unconditionally call dev_pm_opp_of_remove_table()

Message ID 56f1c76a0061dc3ed2d6ea115a3ba8b2e2dee9fd.1597919647.git.viresh.kumar@linaro.org
State Superseded
Headers show
Series [1/8] cpufreq: imx6q: Unconditionally call dev_pm_opp_of_remove_table() | expand

Commit Message

Viresh Kumar Aug. 20, 2020, 10:43 a.m. UTC
dev_pm_opp_of_remove_table() doesn't report any errors when it fails to
find the OPP table with error -ENODEV (i.e. OPP table not present for
the device). And we can call dev_pm_opp_of_remove_table()
unconditionally here.

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

---
 drivers/gpu/drm/lima/lima_devfreq.c | 6 +-----
 drivers/gpu/drm/lima/lima_devfreq.h | 1 -
 2 files changed, 1 insertion(+), 6 deletions(-)

-- 
2.25.0.rc1.19.g042ed3e048af

Comments

Qiang Yu Aug. 23, 2020, 2:53 a.m. UTC | #1
Looks good for me, patch is:
Reviewed-by: Qiang Yu <yuq825@gmail.com>


Regards,
Qiang

On Thu, Aug 20, 2020 at 6:44 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>

> dev_pm_opp_of_remove_table() doesn't report any errors when it fails to

> find the OPP table with error -ENODEV (i.e. OPP table not present for

> the device). And we can call dev_pm_opp_of_remove_table()

> unconditionally here.

>

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

> ---

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

>  drivers/gpu/drm/lima/lima_devfreq.h | 1 -

>  2 files changed, 1 insertion(+), 6 deletions(-)

>

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

> index bbe02817721b..cd290d866a04 100644

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

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

> @@ -105,10 +105,7 @@ void lima_devfreq_fini(struct lima_device *ldev)

>                 devfreq->devfreq = NULL;

>         }

>

> -       if (devfreq->opp_of_table_added) {

> -               dev_pm_opp_of_remove_table(ldev->dev);

> -               devfreq->opp_of_table_added = false;

> -       }

> +       dev_pm_opp_of_remove_table(ldev->dev);

>

>         if (devfreq->regulators_opp_table) {

>                 dev_pm_opp_put_regulators(devfreq->regulators_opp_table);

> @@ -162,7 +159,6 @@ int lima_devfreq_init(struct lima_device *ldev)

>         ret = dev_pm_opp_of_add_table(dev);

>         if (ret)

>                 goto err_fini;

> -       ldevfreq->opp_of_table_added = true;

>

>         lima_devfreq_reset(ldevfreq);

>

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

> index 5eed2975a375..2d9b3008ce77 100644

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

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

> @@ -18,7 +18,6 @@ struct lima_devfreq {

>         struct opp_table *clkname_opp_table;

>         struct opp_table *regulators_opp_table;

>         struct thermal_cooling_device *cooling;

> -       bool opp_of_table_added;

>

>         ktime_t busy_time;

>         ktime_t idle_time;

> --

> 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..cd290d866a04 100644
--- a/drivers/gpu/drm/lima/lima_devfreq.c
+++ b/drivers/gpu/drm/lima/lima_devfreq.c
@@ -105,10 +105,7 @@  void lima_devfreq_fini(struct lima_device *ldev)
 		devfreq->devfreq = NULL;
 	}
 
-	if (devfreq->opp_of_table_added) {
-		dev_pm_opp_of_remove_table(ldev->dev);
-		devfreq->opp_of_table_added = false;
-	}
+	dev_pm_opp_of_remove_table(ldev->dev);
 
 	if (devfreq->regulators_opp_table) {
 		dev_pm_opp_put_regulators(devfreq->regulators_opp_table);
@@ -162,7 +159,6 @@  int lima_devfreq_init(struct lima_device *ldev)
 	ret = dev_pm_opp_of_add_table(dev);
 	if (ret)
 		goto err_fini;
-	ldevfreq->opp_of_table_added = true;
 
 	lima_devfreq_reset(ldevfreq);
 
diff --git a/drivers/gpu/drm/lima/lima_devfreq.h b/drivers/gpu/drm/lima/lima_devfreq.h
index 5eed2975a375..2d9b3008ce77 100644
--- a/drivers/gpu/drm/lima/lima_devfreq.h
+++ b/drivers/gpu/drm/lima/lima_devfreq.h
@@ -18,7 +18,6 @@  struct lima_devfreq {
 	struct opp_table *clkname_opp_table;
 	struct opp_table *regulators_opp_table;
 	struct thermal_cooling_device *cooling;
-	bool opp_of_table_added;
 
 	ktime_t busy_time;
 	ktime_t idle_time;