===================================================================
@@ -421,9 +421,11 @@ static void acpi_thermal_adjust_thermal_
unsigned long data)
{
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
+ int flag = data == ACPI_THERMAL_NOTIFY_THRESHOLDS ?
+ ACPI_TRIPS_THRESHOLDS : ACPI_TRIPS_DEVICES;
int i;
- __acpi_thermal_trips_update(tz, data);
+ __acpi_thermal_trips_update(tz, flag);
if (tz->trips.passive.valid)
acpi_thermal_update_trip_temp(tz, &tz->trips.passive,
@@ -450,8 +452,10 @@ static void acpi_queue_thermal_check(str
queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
}
-static void acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
+static void acpi_thermal_trips_update(struct acpi_thermal *tz, u32 event)
{
+ struct acpi_device *adev = tz->device;
+
/*
* Use thermal_zone_device_adjust() to carry out the trip points
* update, so as to protect thermal_get_trend() from getting stale
@@ -459,8 +463,10 @@ static void acpi_thermal_trips_update(st
* invoked from acpi_thermal_check_fn() from producing inconsistent
* results.
*/
- thermal_zone_device_adjust(tz->thermal_zone, flag);
+ thermal_zone_device_adjust(tz->thermal_zone, event);
acpi_queue_thermal_check(tz);
+ acpi_bus_generate_netlink_event(adev->pnp.device_class,
+ dev_name(&adev->dev), event, 0);
}
static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
@@ -824,14 +830,8 @@ static void acpi_thermal_notify(acpi_han
acpi_queue_thermal_check(tz);
break;
case ACPI_THERMAL_NOTIFY_THRESHOLDS:
- acpi_thermal_trips_update(tz, ACPI_TRIPS_THRESHOLDS);
- acpi_bus_generate_netlink_event(device->pnp.device_class,
- dev_name(&device->dev), event, 0);
- break;
case ACPI_THERMAL_NOTIFY_DEVICES:
- acpi_thermal_trips_update(tz, ACPI_TRIPS_DEVICES);
- acpi_bus_generate_netlink_event(device->pnp.device_class,
- dev_name(&device->dev), event, 0);
+ acpi_thermal_trips_update(tz, event);
break;
default:
acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n",