diff mbox series

[2/6] thermal/core: Remove unused functions rebind/unbind exception

Message ID 20201214233811.485669-2-daniel.lezcano@linaro.org
State Accepted
Commit a20b995b23e41190fb088e7dab4a2b956bf343ae
Headers show
Series [1/6] thermal/core: Remove the 'forced_passive' option | expand

Commit Message

Daniel Lezcano Dec. 14, 2020, 11:38 p.m. UTC
The functions thermal_zone_device_rebind_exception and
thermal_zone_device_unbind_exception are not used from anywhere.

Remove that code.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

---
 drivers/thermal/thermal_core.c | 37 ----------------------------------
 drivers/thermal/thermal_core.h |  4 ----
 2 files changed, 41 deletions(-)

-- 
2.25.1

Comments

Thara Gopinath Jan. 11, 2021, 11:15 p.m. UTC | #1
On 12/14/20 6:38 PM, Daniel Lezcano wrote:
> The functions thermal_zone_device_rebind_exception and

> thermal_zone_device_unbind_exception are not used from anywhere.

> 

> Remove that code.

> 

> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>


Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org>


> ---

>   drivers/thermal/thermal_core.c | 37 ----------------------------------

>   drivers/thermal/thermal_core.h |  4 ----

>   2 files changed, 41 deletions(-)

> 

> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c

> index 567bc6f254c0..a0f0c33c8d9c 100644

> --- a/drivers/thermal/thermal_core.c

> +++ b/drivers/thermal/thermal_core.c

> @@ -598,26 +598,6 @@ static void thermal_zone_device_check(struct work_struct *work)

>   	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);

>   }

>   

> -void thermal_zone_device_rebind_exception(struct thermal_zone_device *tz,

> -					  const char *cdev_type, size_t size)

> -{

> -	struct thermal_cooling_device *cdev = NULL;

> -

> -	mutex_lock(&thermal_list_lock);

> -	list_for_each_entry(cdev, &thermal_cdev_list, node) {

> -		/* skip non matching cdevs */

> -		if (strncmp(cdev_type, cdev->type, size))

> -			continue;

> -

> -		/* re binding the exception matching the type pattern */

> -		thermal_zone_bind_cooling_device(tz, THERMAL_TRIPS_NONE, cdev,

> -						 THERMAL_NO_LIMIT,

> -						 THERMAL_NO_LIMIT,

> -						 THERMAL_WEIGHT_DEFAULT);

> -	}

> -	mutex_unlock(&thermal_list_lock);

> -}

> -

>   int for_each_thermal_governor(int (*cb)(struct thermal_governor *, void *),

>   			      void *data)

>   {

> @@ -685,23 +665,6 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id)

>   	return match;

>   }

>   

> -void thermal_zone_device_unbind_exception(struct thermal_zone_device *tz,

> -					  const char *cdev_type, size_t size)

> -{

> -	struct thermal_cooling_device *cdev = NULL;

> -

> -	mutex_lock(&thermal_list_lock);

> -	list_for_each_entry(cdev, &thermal_cdev_list, node) {

> -		/* skip non matching cdevs */

> -		if (strncmp(cdev_type, cdev->type, size))

> -			continue;

> -		/* unbinding the exception matching the type pattern */

> -		thermal_zone_unbind_cooling_device(tz, THERMAL_TRIPS_NONE,

> -						   cdev);

> -	}

> -	mutex_unlock(&thermal_list_lock);

> -}

> -

>   /*

>    * Device management section: cooling devices, zones devices, and binding

>    *

> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h

> index 8df600fa7b79..e50c6b2909fe 100644

> --- a/drivers/thermal/thermal_core.h

> +++ b/drivers/thermal/thermal_core.h

> @@ -118,10 +118,6 @@ struct thermal_instance {

>   

>   int thermal_register_governor(struct thermal_governor *);

>   void thermal_unregister_governor(struct thermal_governor *);

> -void thermal_zone_device_rebind_exception(struct thermal_zone_device *,

> -					  const char *, size_t);

> -void thermal_zone_device_unbind_exception(struct thermal_zone_device *,

> -					  const char *, size_t);

>   int thermal_zone_device_set_policy(struct thermal_zone_device *, char *);

>   int thermal_build_list_of_policies(char *buf);

>   

> 


-- 
Warm Regards
Thara
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 567bc6f254c0..a0f0c33c8d9c 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -598,26 +598,6 @@  static void thermal_zone_device_check(struct work_struct *work)
 	thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
 }
 
-void thermal_zone_device_rebind_exception(struct thermal_zone_device *tz,
-					  const char *cdev_type, size_t size)
-{
-	struct thermal_cooling_device *cdev = NULL;
-
-	mutex_lock(&thermal_list_lock);
-	list_for_each_entry(cdev, &thermal_cdev_list, node) {
-		/* skip non matching cdevs */
-		if (strncmp(cdev_type, cdev->type, size))
-			continue;
-
-		/* re binding the exception matching the type pattern */
-		thermal_zone_bind_cooling_device(tz, THERMAL_TRIPS_NONE, cdev,
-						 THERMAL_NO_LIMIT,
-						 THERMAL_NO_LIMIT,
-						 THERMAL_WEIGHT_DEFAULT);
-	}
-	mutex_unlock(&thermal_list_lock);
-}
-
 int for_each_thermal_governor(int (*cb)(struct thermal_governor *, void *),
 			      void *data)
 {
@@ -685,23 +665,6 @@  struct thermal_zone_device *thermal_zone_get_by_id(int id)
 	return match;
 }
 
-void thermal_zone_device_unbind_exception(struct thermal_zone_device *tz,
-					  const char *cdev_type, size_t size)
-{
-	struct thermal_cooling_device *cdev = NULL;
-
-	mutex_lock(&thermal_list_lock);
-	list_for_each_entry(cdev, &thermal_cdev_list, node) {
-		/* skip non matching cdevs */
-		if (strncmp(cdev_type, cdev->type, size))
-			continue;
-		/* unbinding the exception matching the type pattern */
-		thermal_zone_unbind_cooling_device(tz, THERMAL_TRIPS_NONE,
-						   cdev);
-	}
-	mutex_unlock(&thermal_list_lock);
-}
-
 /*
  * Device management section: cooling devices, zones devices, and binding
  *
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 8df600fa7b79..e50c6b2909fe 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -118,10 +118,6 @@  struct thermal_instance {
 
 int thermal_register_governor(struct thermal_governor *);
 void thermal_unregister_governor(struct thermal_governor *);
-void thermal_zone_device_rebind_exception(struct thermal_zone_device *,
-					  const char *, size_t);
-void thermal_zone_device_unbind_exception(struct thermal_zone_device *,
-					  const char *, size_t);
 int thermal_zone_device_set_policy(struct thermal_zone_device *, char *);
 int thermal_build_list_of_policies(char *buf);