mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
generic: kernel 6.6: fixes thermal driver
This commit is contained in:
parent
166b4bd84e
commit
d856657965
@ -5961,6 +5961,7 @@ CONFIG_SERIAL_EARLYCON=y
|
||||
# CONFIG_SG_SPLIT is not set
|
||||
# CONFIG_SHADOW_CALL_STACK is not set
|
||||
CONFIG_SHMEM=y
|
||||
# CONFIG_SHORTCUT_FE is not set
|
||||
# CONFIG_SHRINKER_DEBUG is not set
|
||||
# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
|
||||
# CONFIG_SH_ETH is not set
|
||||
|
@ -5630,6 +5630,7 @@ CONFIG_SERIAL_EARLYCON=y
|
||||
# CONFIG_SG_SPLIT is not set
|
||||
# CONFIG_SHADOW_CALL_STACK is not set
|
||||
CONFIG_SHMEM=y
|
||||
# CONFIG_SHORTCUT_FE is not set
|
||||
# CONFIG_SHRINKER_DEBUG is not set
|
||||
# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
|
||||
# CONFIG_SH_ETH is not set
|
||||
|
@ -71,41 +71,6 @@
|
||||
struct thermal_zone_device *thermal_tripless_zone_device_register(
|
||||
const char *type,
|
||||
void *devdata,
|
||||
--- a/drivers/thermal/thermal_trip.c
|
||||
+++ b/drivers/thermal/thermal_trip.c
|
||||
@@ -113,11 +113,29 @@ void __thermal_zone_set_trips(struct the
|
||||
int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
|
||||
struct thermal_trip *trip)
|
||||
{
|
||||
- if (!tz || !tz->trips || trip_id < 0 || trip_id >= tz->num_trips || !trip)
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
|
||||
return -EINVAL;
|
||||
|
||||
- *trip = tz->trips[trip_id];
|
||||
- return 0;
|
||||
+ if (tz->trips) {
|
||||
+ *trip = tz->trips[trip_id];
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (tz->ops->get_trip_hyst) {
|
||||
+ ret = tz->ops->get_trip_hyst(tz, trip_id, &trip->hysteresis);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ } else {
|
||||
+ trip->hysteresis = 0;
|
||||
+ }
|
||||
+
|
||||
+ ret = tz->ops->get_trip_temp(tz, trip_id, &trip->temperature);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ return tz->ops->get_trip_type(tz, trip_id, &trip->type);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);
|
||||
|
||||
--- a/include/linux/thermal.h
|
||||
+++ b/include/linux/thermal.h
|
||||
@@ -76,7 +76,11 @@ struct thermal_zone_device_ops {
|
||||
|
Loading…
Reference in New Issue
Block a user