x86 boot code comments typos
[safe/jmp/linux-2.6] / drivers / acpi / thermal.c
index 1ada017..5a62de1 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/jiffies.h>
 #include <linux/kmod.h>
 #include <linux/seq_file.h>
+#include <linux/reboot.h>
 #include <asm/uaccess.h>
 
 #include <acpi/acpi_bus.h>
@@ -59,7 +60,6 @@
 #define ACPI_THERMAL_NOTIFY_CRITICAL   0xF0
 #define ACPI_THERMAL_NOTIFY_HOT                0xF1
 #define ACPI_THERMAL_MODE_ACTIVE       0x00
-#define ACPI_THERMAL_PATH_POWEROFF     "/sbin/poweroff"
 
 #define ACPI_THERMAL_MAX_ACTIVE        10
 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
@@ -92,10 +92,16 @@ static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file);
 static ssize_t acpi_thermal_write_polling(struct file *, const char __user *,
                                          size_t, loff_t *);
 
+static const struct acpi_device_id  thermal_device_ids[] = {
+       {ACPI_THERMAL_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
+
 static struct acpi_driver acpi_thermal_driver = {
        .name = "thermal",
        .class = ACPI_THERMAL_CLASS,
-       .ids = ACPI_THERMAL_HID,
+       .ids = thermal_device_ids,
        .ops = {
                .add = acpi_thermal_add,
                .remove = acpi_thermal_remove,
@@ -419,26 +425,6 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz)
        return 0;
 }
 
-static int acpi_thermal_call_usermode(char *path)
-{
-       char *argv[2] = { NULL, NULL };
-       char *envp[3] = { NULL, NULL, NULL };
-
-
-       if (!path)
-               return -EINVAL;
-
-       argv[0] = path;
-
-       /* minimal command environment */
-       envp[0] = "HOME=/";
-       envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
-
-       call_usermodehelper(argv[0], argv, envp, 0);
-
-       return 0;
-}
-
 static int acpi_thermal_critical(struct acpi_thermal *tz)
 {
        if (!tz || !tz->trips.critical.flags.valid)
@@ -456,7 +442,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
        acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
                                tz->trips.critical.flags.enabled);
 
-       acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
+       orderly_poweroff(true);
 
        return 0;
 }
@@ -827,6 +813,9 @@ static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
 static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
 {
        struct acpi_thermal *tz = seq->private;
+       struct acpi_device *device;
+       acpi_status status;
+
        int i = 0;
        int j = 0;
 
@@ -849,9 +838,10 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
                           tz->trips.passive.tc1, tz->trips.passive.tc2,
                           tz->trips.passive.tsp);
                for (j = 0; j < tz->trips.passive.devices.count; j++) {
-
-                       seq_printf(seq, "0x%p ",
-                                  tz->trips.passive.devices.handles[j]);
+                       status = acpi_bus_get_device(tz->trips.passive.devices.
+                                                    handles[j], &device);
+                       seq_printf(seq, "%4.4s ", status ? "" :
+                                  acpi_device_bid(device));
                }
                seq_puts(seq, "\n");
        }
@@ -862,9 +852,13 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
                seq_printf(seq, "active[%d]:               %ld C: devices=",
                           i,
                           KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
-               for (j = 0; j < tz->trips.active[i].devices.count; j++)
-                       seq_printf(seq, "0x%p ",
-                                  tz->trips.active[i].devices.handles[j]);
+               for (j = 0; j < tz->trips.active[i].devices.count; j++){
+                       status = acpi_bus_get_device(tz->trips.active[i].
+                                                    devices.handles[j],
+                                                    &device);
+                       seq_printf(seq, "%4.4s ", status ? "" :
+                                  acpi_device_bid(device));
+               }
                seq_puts(seq, "\n");
        }