Skip to contentSkip to conversation

thermal/core: Make cooling device state change private

PATCH Applied Daniel Lezcano 3 participants 3 messages Jan 18, 2021 – Feb 4, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 thermal/core: Make cooling device state change private

The change of the cooling device state should be used by the governor or at least by the core code, not by the drivers themselves.

Remove the API usage and move the function declaration to the internal headers.

---
 drivers/hwmon/pwm-fan.c          | 1 -
 drivers/thermal/khadas_mcu_fan.c | 1 -
 drivers/thermal/thermal_core.h   | 2 ++
 include/linux/thermal.h          | 3 ---
 4 files changed, 2 insertions(+), 5 deletions(-)
drivers/hwmon/pwm-fan.c +0 -1
index bdba2143021a..0b1159ceac9b 100644
@@ -378,7 +378,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
 			return ret;
 		}
 		ctx->cdev = cdev;
-		thermal_cdev_update(cdev);
 	}
 
 	return 0;
drivers/thermal/khadas_mcu_fan.c +0 -1
index 9eadd2d6413e..d35e5313bea4 100644
@@ -100,7 +100,6 @@ static int khadas_mcu_fan_probe(struct platform_device *pdev)
 		return ret;
 	}
 	ctx->cdev = cdev;
-	thermal_cdev_update(cdev);
 
 	return 0;
 }
drivers/thermal/thermal_core.h +2 -0
index 90f9a80c8b23..86b8cef7310e 100644
@@ -65,6 +65,8 @@ static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
 		cdev->ops->power2state;
 }
 
+void thermal_cdev_update(struct thermal_cooling_device *);
+
 /**
  * struct thermal_trip - representation of a point in temperature domain
  * @np: pointer to struct device_node that this trip point was created from
include/linux/thermal.h +0 -3
index 1e686404951b..6ac7bb1d2b1f 100644
@@ -390,7 +390,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
 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);
 int thermal_zone_device_enable(struct thermal_zone_device *tz);
 int thermal_zone_device_disable(struct thermal_zone_device *tz);
@@ -437,8 +436,6 @@ static inline int thermal_zone_get_offset(
 		struct thermal_zone_device *tz)
 { return -ENODEV; }
 
-static inline void thermal_cdev_update(struct thermal_cooling_device *cdev)
-{ }
 static inline void thermal_notify_framework(struct thermal_zone_device *tz,
 	int trip)
 { }
Signature · 7 lines
2.17.1


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
reviewer Acked-by on v2 1/1
#1 lore raw
Quoted 16 lines

-----Original Message-----
From: Daniel Lezcano <[email protected]>
Sent: Tuesday, January 19, 2021 1:38 AM
To: [email protected]; Zhang, Rui <[email protected]>
Cc: Guenter Roeck <[email protected]>; Kamil Debski <[email protected]>; Bartlomiej Zolnierkiewicz <[email protected]>; Jean Delvare <[email protected]>; Neil Armstrong <[email protected]>; Amit Kucheria <[email protected]>; open list:PWM FAN DRIVER <linux- [email protected]>; open list <[email protected]>; open list:KHADAS MCU MFD DRIVER <[email protected]>; open list:THERMAL <[email protected]>
Subject: [PATCH v2] thermal/core: Make cooling device state change private
Importance: High

Quoted 8 lines

The change of the cooling device state should be used by the governor or at least by the core code, not by the drivers themselves.

Remove the API usage and move the function declaration to the internal headers.

Thanks,
rui

Quoted 66 lines
---
 drivers/hwmon/pwm-fan.c          | 1 -
 drivers/thermal/khadas_mcu_fan.c | 1 -
 drivers/thermal/thermal_core.h   | 2 ++
 include/linux/thermal.h          | 3 ---
 4 files changed, 2 insertions(+), 5 deletions(-)
drivers/hwmon/pwm-fan.c index renamed from drivers/hwmon/pwm-fan.c +0 -0

bdba2143021a..0b1159ceac9b 100644

drivers/hwmon/pwm-fan.c +0 -1
@@ -378,7 +378,6 @@ static int pwm_fan_probe(struct platform_device
 *pdev)
 			return ret;
 		}
 		ctx->cdev = cdev;
-		thermal_cdev_update(cdev);
 	}
 
drivers/hwmon/pwm-fan.c +0 -0
 	return 0;
drivers/thermal/khadas_mcu_fan.c +0 -1
index 9eadd2d6413e..d35e5313bea4 100644
@@ -100,7 +100,6 @@ static int khadas_mcu_fan_probe(struct
 platform_device *pdev)
 		return ret;
 	}
 	ctx->cdev = cdev;
-	thermal_cdev_update(cdev);
 
 	return 0;

}

(quoted diff) +0 -0

b/drivers/thermal/thermal_core.h index 90f9a80c8b23..86b8cef7310e 100644

drivers/thermal/thermal_core.h +2 -0
@@ -65,6 +65,8 @@ static inline bool cdev_is_power_actor(struct
 thermal_cooling_device *cdev)
 		cdev->ops->power2state;
 }
 
+void thermal_cdev_update(struct thermal_cooling_device *);
+
 /**
  * struct thermal_trip - representation of a point in temperature domain

* @np: pointer to struct device_node that this trip point was created from

include/linux/thermal.h index renamed from include/linux/thermal.h +0 -0

1e686404951b..6ac7bb1d2b1f 100644

include/linux/thermal.h +0 -0
@@ -390,7 +390,6 @@ int thermal_zone_get_temp(struct

thermal_zone_device *tz, int *temp); 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); int thermal_zone_device_enable(struct thermal_zone_device *tz); int thermal_zone_device_disable(struct thermal_zone_device *tz); @@ -437,8 +436,6 @@ static inline int thermal_zone_get_offset(

include/linux/thermal.h +0 -1
 		struct thermal_zone_device *tz)
 { return -ENODEV; }
 
-static inline void thermal_cdev_update(struct thermal_cooling_device
Quoted 6 lines

*cdev) -{ } static inline void thermal_notify_framework(struct thermal_zone_device *tz,
int trip)
{ }
--
2.17.1

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#2 lore raw
In reply to Daniel Lezcano
The following commit has been merged into the thermal/next branch of thermal:

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     23ff8529ee207c634ce2e170c353938db7aa98a9
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//23ff8529ee207c634ce2e170c353938db7aa98a9
Author:        Daniel Lezcano <[email protected]>
AuthorDate:    Mon, 18 Jan 2021 18:38:24 +01:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Tue, 19 Jan 2021 22:31:10 +01:00

thermal/core: Make cooling device state change private

The change of the cooling device state should be used by the governor or at least by the core code, not by the drivers themselves.

Remove the API usage and move the function declaration to the internal headers.

---
 drivers/hwmon/pwm-fan.c          | 1 -
 drivers/thermal/khadas_mcu_fan.c | 1 -
 drivers/thermal/thermal_core.h   | 2 ++
 include/linux/thermal.h          | 3 ---
 4 files changed, 2 insertions(+), 5 deletions(-)
drivers/hwmon/pwm-fan.c +0 -1
index 777439f..c8a1597 100644
@@ -422,7 +422,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
 			return ret;
 		}
 		ctx->cdev = cdev;
-		thermal_cdev_update(cdev);
 	}
 
 	return 0;
drivers/thermal/khadas_mcu_fan.c +0 -1
index 9eadd2d..d35e531 100644
@@ -100,7 +100,6 @@ static int khadas_mcu_fan_probe(struct platform_device *pdev)
 		return ret;
 	}
 	ctx->cdev = cdev;
-	thermal_cdev_update(cdev);
 
 	return 0;
 }
drivers/thermal/thermal_core.h +2 -0
index 90f9a80..86b8cef 100644
@@ -65,6 +65,8 @@ static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
 		cdev->ops->power2state;
 }
 
+void thermal_cdev_update(struct thermal_cooling_device *);
+
 /**
  * struct thermal_trip - representation of a point in temperature domain
  * @np: pointer to struct device_node that this trip point was created from
include/linux/thermal.h +0 -3
index 1e68640..6ac7bb1 100644
@@ -390,7 +390,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
 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);
 int thermal_zone_device_enable(struct thermal_zone_device *tz);
 int thermal_zone_device_disable(struct thermal_zone_device *tz);
@@ -437,8 +436,6 @@ static inline int thermal_zone_get_offset(
 		struct thermal_zone_device *tz)
 { return -ENODEV; }
 
-static inline void thermal_cdev_update(struct thermal_cooling_device *cdev)
-{ }
 static inline void thermal_notify_framework(struct thermal_zone_device *tz,
 	int trip)
 { }