diff mbox series

[2/6] thermal: core: delete thermal_notify_framework()

Message ID 20200430063229.6182-3-rui.zhang@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Zhang Rui
Headers show
Series thermal: improve handling of disabled thermal zone | expand

Commit Message

Zhang Rui April 30, 2020, 6:32 a.m. UTC
Delete thermal_notify_framework() as there is no user of it.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/thermal_core.c | 18 ------------------
 include/linux/thermal.h        |  4 ----
 2 files changed, 22 deletions(-)

Comments

Andrzej Pietrasiewicz April 30, 2020, 8:47 a.m. UTC | #1
Hi Rui,

Thanks for the series,

W dniu 30.04.2020 o 08:32, Zhang Rui pisze:
> Delete thermal_notify_framework() as there is no user of it.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>   drivers/thermal/thermal_core.c | 18 ------------------
>   include/linux/thermal.h        |  4 ----
>   2 files changed, 22 deletions(-)
> 

git grep thermal_notify_framework
Documentation/driver-api/thermal/sysfs-api.rst:4.3. thermal_notify_framework

Should the documentation be still documenting a non-existent function?

BTW, get_tz_trend() is only used in drivers/thermal/step_wise.c,
but is still exported with EXPORT_SYMBOL(). Probably does not need to
be exported anymore.

Andrzej
Zhang Rui April 30, 2020, 8:58 a.m. UTC | #2
> -----Original Message-----
> From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> Sent: Thursday, April 30, 2020 4:47 PM
> To: Zhang, Rui <rui.zhang@intel.com>; linux-pm@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org; daniel.lezcano@linaro.org;
> b.zolnierkie@samsung.com; luca@coelho.fi
> Subject: Re: [PATCH 2/6] thermal: core: delete thermal_notify_framework()
> Importance: High
> 
> Hi Rui,
> 
> Thanks for the series,
> 
> W dniu 30.04.2020 o 08:32, Zhang Rui pisze:
> > Delete thermal_notify_framework() as there is no user of it.
> >
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> >   drivers/thermal/thermal_core.c | 18 ------------------
> >   include/linux/thermal.h        |  4 ----
> >   2 files changed, 22 deletions(-)
> >
> 
> git grep thermal_notify_framework
> Documentation/driver-api/thermal/sysfs-api.rst:4.3.
> thermal_notify_framework
> 
> Should the documentation be still documenting a non-existent function?
> 
Right, thanks for the reminder.
Will clean it up in next version.

> BTW, get_tz_trend() is only used in drivers/thermal/step_wise.c, but is still
> exported with EXPORT_SYMBOL(). Probably does not need to be exported
> anymore.
> 
Right, that worth a separate cleanup patch.

Can you please try this patch and confirm the polling timers are queued/cancelled as expected?

thanks,
rui
Andrzej Pietrasiewicz April 30, 2020, 11:32 a.m. UTC | #3
Hi Rui,

W dniu 30.04.2020 o 10:58, Zhang, Rui pisze:
> 
>> -----Original Message-----
>> From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
>> Sent: Thursday, April 30, 2020 4:47 PM
>> To: Zhang, Rui <rui.zhang@intel.com>; linux-pm@vger.kernel.org
>> Cc: linux-wireless@vger.kernel.org; daniel.lezcano@linaro.org;
>> b.zolnierkie@samsung.com; luca@coelho.fi
>> Subject: Re: [PATCH 2/6] thermal: core: delete thermal_notify_framework()
>> Importance: High
>>
>> Hi Rui,
>>
>> Thanks for the series,
>>
>> W dniu 30.04.2020 o 08:32, Zhang Rui pisze:
>>> Delete thermal_notify_framework() as there is no user of it.
>>>
>>> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

<snip>

> Can you please try this patch and confirm the polling timers are queued/cancelled as expected?
> 

Yes, they are. I'm testing on an x86 machine with drivers/acpi/thermal.c.

Tested-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Andrzej Pietrasiewicz April 30, 2020, 11:33 a.m. UTC | #4
W dniu 30.04.2020 o 13:32, Andrzej Pietrasiewicz pisze:
> Hi Rui,
> 
> W dniu 30.04.2020 o 10:58, Zhang, Rui pisze:
>>
>>> -----Original Message-----
>>> From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
>>> Sent: Thursday, April 30, 2020 4:47 PM
>>> To: Zhang, Rui <rui.zhang@intel.com>; linux-pm@vger.kernel.org
>>> Cc: linux-wireless@vger.kernel.org; daniel.lezcano@linaro.org;
>>> b.zolnierkie@samsung.com; luca@coelho.fi
>>> Subject: Re: [PATCH 2/6] thermal: core: delete thermal_notify_framework()
>>> Importance: High
>>>
>>> Hi Rui,
>>>
>>> Thanks for the series,
>>>
>>> W dniu 30.04.2020 o 08:32, Zhang Rui pisze:
>>>> Delete thermal_notify_framework() as there is no user of it.
>>>>
>>>> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> 
> <snip>
> 
>> Can you please try this patch and confirm the polling timers are 
>> queued/cancelled as expected?
>>
> 
> Yes, they are. I'm testing on an x86 machine with drivers/acpi/thermal.c.

I should've said x86_64.

> 
> Tested-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
>
Andrzej Pietrasiewicz May 4, 2020, 10:18 a.m. UTC | #5
Hi Rui,

W dniu 30.04.2020 o 08:32, Zhang Rui pisze:
> Delete thermal_notify_framework() as there is no user of it.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Provided that PATCH 1/6 is applied:

Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>

> ---
>   drivers/thermal/thermal_core.c | 18 ------------------
>   include/linux/thermal.h        |  4 ----
>   2 files changed, 22 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 03c4d8d..ac70545 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -532,24 +532,6 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
>   }
>   EXPORT_SYMBOL_GPL(thermal_zone_device_update);
>   
> -/**
> - * thermal_notify_framework - Sensor drivers use this API to notify framework
> - * @tz:		thermal zone device
> - * @trip:	indicates which trip point has been crossed
> - *
> - * This function handles the trip events from sensor drivers. It starts
> - * throttling the cooling devices according to the policy configured.
> - * For CRITICAL and HOT trip points, this notifies the respective drivers,
> - * and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
> - * The throttling policy is based on the configured platform data; if no
> - * platform data is provided, this uses the step_wise throttling policy.
> - */
> -void thermal_notify_framework(struct thermal_zone_device *tz, int trip)
> -{
> -	handle_thermal_trip(tz, trip);
> -}
> -EXPORT_SYMBOL_GPL(thermal_notify_framework);
> -
>   static void thermal_zone_device_check(struct work_struct *work)
>   {
>   	struct thermal_zone_device *tz = container_of(work, struct
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index c789d4f..a87fbaf 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -420,7 +420,6 @@ int thermal_zone_get_slope(struct thermal_zone_device *tz);
>   int thermal_zone_get_offset(struct thermal_zone_device *tz);
>   
>   void thermal_cdev_update(struct thermal_cooling_device *);
> -void thermal_notify_framework(struct thermal_zone_device *, int);
>   #else
>   static inline struct thermal_zone_device *thermal_zone_device_register(
>   	const char *type, int trips, int mask, void *devdata,
> @@ -468,9 +467,6 @@ static inline int thermal_zone_get_offset(
>   
>   static inline void thermal_cdev_update(struct thermal_cooling_device *cdev)
>   { }
> -static inline void thermal_notify_framework(struct thermal_zone_device *tz,
> -	int trip)
> -{ }
>   #endif /* CONFIG_THERMAL */
>   
>   static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
>
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 03c4d8d..ac70545 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -532,24 +532,6 @@  void thermal_zone_device_update(struct thermal_zone_device *tz,
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 
-/**
- * thermal_notify_framework - Sensor drivers use this API to notify framework
- * @tz:		thermal zone device
- * @trip:	indicates which trip point has been crossed
- *
- * This function handles the trip events from sensor drivers. It starts
- * throttling the cooling devices according to the policy configured.
- * For CRITICAL and HOT trip points, this notifies the respective drivers,
- * and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
- * The throttling policy is based on the configured platform data; if no
- * platform data is provided, this uses the step_wise throttling policy.
- */
-void thermal_notify_framework(struct thermal_zone_device *tz, int trip)
-{
-	handle_thermal_trip(tz, trip);
-}
-EXPORT_SYMBOL_GPL(thermal_notify_framework);
-
 static void thermal_zone_device_check(struct work_struct *work)
 {
 	struct thermal_zone_device *tz = container_of(work, struct
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index c789d4f..a87fbaf 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -420,7 +420,6 @@  int thermal_zone_get_slope(struct thermal_zone_device *tz);
 int thermal_zone_get_offset(struct thermal_zone_device *tz);
 
 void thermal_cdev_update(struct thermal_cooling_device *);
-void thermal_notify_framework(struct thermal_zone_device *, int);
 #else
 static inline struct thermal_zone_device *thermal_zone_device_register(
 	const char *type, int trips, int mask, void *devdata,
@@ -468,9 +467,6 @@  static inline int thermal_zone_get_offset(
 
 static inline void thermal_cdev_update(struct thermal_cooling_device *cdev)
 { }
-static inline void thermal_notify_framework(struct thermal_zone_device *tz,
-	int trip)
-{ }
 #endif /* CONFIG_THERMAL */
 
 static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)