thermal/core: Make cooling device state change private
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 18 Jan 2021 17:38:24 +0000 (18:38 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 19 Jan 2021 21:31:10 +0000 (22:31 +0100)
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.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Link: https://lore.kernel.org/r/20210118173824.9970-1-daniel.lezcano@linaro.org
drivers/hwmon/pwm-fan.c
drivers/thermal/khadas_mcu_fan.c
drivers/thermal/thermal_core.h
include/linux/thermal.h

index 777439f48c1471a1cbd02d5b32208367ddf44b2d..c8a15971d7048e883079a88db7f142e4947875e3 100644 (file)
@@ -422,7 +422,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
                        return ret;
                }
                ctx->cdev = cdev;
-               thermal_cdev_update(cdev);
        }
 
        return 0;
index 9eadd2d6413e42b7f41a708e9072f5a84b98339b..d35e5313bea41ab83ff9fb5a57e1230263434a56 100644 (file)
@@ -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;
 }
index 90f9a80c8b23857c40558218b962fab551621533..86b8cef7310ea08e96d3ee8f1c03ed40100982be 100644 (file)
@@ -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
index 1e686404951b94ea600c1c8fb1ba2f337668636b..6ac7bb1d2b1fcaeba948fbcc88138e5c2efa492d 100644 (file)
@@ -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)
 { }