From 46b4cc5651dde8b2eff205cf6d57d0449641f0c9 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Thu, 24 Sep 2009 23:47:10 +0000 Subject: [PATCH] Unbreak acpi_thermal driver. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33281 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../drivers/power/acpi_thermal/acpi_thermal.c | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/add-ons/kernel/drivers/power/acpi_thermal/acpi_thermal.c b/src/add-ons/kernel/drivers/power/acpi_thermal/acpi_thermal.c index 378dc3ef11..5b19299fdb 100644 --- a/src/add-ons/kernel/drivers/power/acpi_thermal/acpi_thermal.c +++ b/src/add-ons/kernel/drivers/power/acpi_thermal/acpi_thermal.c @@ -120,8 +120,10 @@ acpi_thermal_control(void* _cookie, uint32 op, void* arg, size_t len) acpi_thermal_type *att = NULL; - size_t bufsize = sizeof(acpi_object_type); - acpi_object_type buf; + uint32 integer; + acpi_data buffer; + buffer.pointer = &integer; + buffer.length = sizeof(integer); switch (op) { case drvOpGetThermalType: { @@ -129,16 +131,13 @@ acpi_thermal_control(void* _cookie, uint32 op, void* arg, size_t len) att = (acpi_thermal_type *)arg; // Read basic temperature thresholds. - err = device->acpi->evaluate_method(device->acpi_cookie, "_CRT", &buf, bufsize, NULL, 0); - att->critical_temp = buf.data.integer; - err = device->acpi->evaluate_method(device->acpi_cookie, "_TMP", &buf, bufsize, NULL, 0); - att->current_temp = buf.data.integer; - err = device->acpi->evaluate_method(device->acpi_cookie, "_HOT", &buf, bufsize, NULL, 0); - if (err == B_OK) { - att->hot_temp = buf.data.integer; - } else { - att->hot_temp = 0; - } + err = device->acpi->evaluate_method(device->acpi_cookie, "_CRT", NULL, &buffer); + att->critical_temp = (err == B_OK) ? integer : 0; + err = device->acpi->evaluate_method(device->acpi_cookie, "_TMP", NULL, &buffer); + att->current_temp = (err == B_OK) ? integer : 0; + err = device->acpi->evaluate_method(device->acpi_cookie, "_HOT", NULL, &buffer); + att->hot_temp = (err == B_OK) ? integer : 0; + dprintf("acpi_thermal: GotBasicTemperatures()\n"); // Read Passive Cooling devices @@ -227,7 +226,6 @@ acpi_thermal_uninit_driver(void *driverCookie) static status_t acpi_thermal_register_child_devices(void *_cookie) { - status_t err; device_node *node = _cookie; int path_id; char name[128];