Merge tag '5.15-rc-ksmbd-part2' of git://git.samba.org/ksmbd
[linux-2.6-microblaze.git] / drivers / acpi / thermal.c
index 4f90638..95105db 100644 (file)
@@ -670,27 +670,24 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
        return 0;
 }
 
-
-static int thermal_notify(struct thermal_zone_device *thermal, int trip,
-                          enum thermal_trip_type trip_type)
+static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
 {
-       u8 type = 0;
        struct acpi_thermal *tz = thermal->devdata;
 
-       if (trip_type == THERMAL_TRIP_CRITICAL)
-               type = ACPI_THERMAL_NOTIFY_CRITICAL;
-       else if (trip_type == THERMAL_TRIP_HOT)
-               type = ACPI_THERMAL_NOTIFY_HOT;
-       else
-               return 0;
-
        acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
-                                       dev_name(&tz->device->dev), type, 1);
+                                       dev_name(&tz->device->dev),
+                                       ACPI_THERMAL_NOTIFY_HOT, 1);
+}
 
-       if (trip_type == THERMAL_TRIP_CRITICAL && nocrt)
-               return 1;
+static void acpi_thermal_zone_device_critical(struct thermal_zone_device *thermal)
+{
+       struct acpi_thermal *tz = thermal->devdata;
 
-       return 0;
+       acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
+                                       dev_name(&tz->device->dev),
+                                       ACPI_THERMAL_NOTIFY_CRITICAL, 1);
+
+       thermal_zone_device_critical(thermal);
 }
 
 static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
@@ -760,25 +757,6 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
                }
        }
 
-       for (i = 0; i < tz->devices.count; i++) {
-               handle = tz->devices.handles[i];
-               status = acpi_bus_get_device(handle, &dev);
-               if (ACPI_SUCCESS(status) && (dev == device)) {
-                       if (bind)
-                               result = thermal_zone_bind_cooling_device
-                                               (thermal, THERMAL_TRIPS_NONE,
-                                                cdev, THERMAL_NO_LIMIT,
-                                                THERMAL_NO_LIMIT,
-                                                THERMAL_WEIGHT_DEFAULT);
-                       else
-                               result = thermal_zone_unbind_cooling_device
-                                               (thermal, THERMAL_TRIPS_NONE,
-                                                cdev);
-                       if (result)
-                               goto failed;
-               }
-       }
-
 failed:
        return result;
 }
@@ -805,7 +783,8 @@ static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
        .get_trip_temp = thermal_get_trip_temp,
        .get_crit_temp = thermal_get_crit_temp,
        .get_trend = thermal_get_trend,
-       .notify = thermal_notify,
+       .hot = acpi_thermal_zone_device_hot,
+       .critical = acpi_thermal_zone_device_critical,
 };
 
 static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)