aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 88a6fc7fd271..58f1338981bc 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -40,6 +40,7 @@
40#include <linux/jiffies.h> 40#include <linux/jiffies.h>
41#include <linux/kmod.h> 41#include <linux/kmod.h>
42#include <linux/seq_file.h> 42#include <linux/seq_file.h>
43#include <linux/reboot.h>
43#include <asm/uaccess.h> 44#include <asm/uaccess.h>
44 45
45#include <acpi/acpi_bus.h> 46#include <acpi/acpi_bus.h>
@@ -59,7 +60,6 @@
59#define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0 60#define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0
60#define ACPI_THERMAL_NOTIFY_HOT 0xF1 61#define ACPI_THERMAL_NOTIFY_HOT 0xF1
61#define ACPI_THERMAL_MODE_ACTIVE 0x00 62#define ACPI_THERMAL_MODE_ACTIVE 0x00
62#define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff"
63 63
64#define ACPI_THERMAL_MAX_ACTIVE 10 64#define ACPI_THERMAL_MAX_ACTIVE 10
65#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 65#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
@@ -419,26 +419,6 @@ static int acpi_thermal_get_devices(struct acpi_thermal *tz)
419 return 0; 419 return 0;
420} 420}
421 421
422static int acpi_thermal_call_usermode(char *path)
423{
424 char *argv[2] = { NULL, NULL };
425 char *envp[3] = { NULL, NULL, NULL };
426
427
428 if (!path)
429 return -EINVAL;
430
431 argv[0] = path;
432
433 /* minimal command environment */
434 envp[0] = "HOME=/";
435 envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
436
437 call_usermodehelper(argv[0], argv, envp, 0);
438
439 return 0;
440}
441
442static int acpi_thermal_critical(struct acpi_thermal *tz) 422static int acpi_thermal_critical(struct acpi_thermal *tz)
443{ 423{
444 if (!tz || !tz->trips.critical.flags.valid) 424 if (!tz || !tz->trips.critical.flags.valid)
@@ -456,7 +436,7 @@ static int acpi_thermal_critical(struct acpi_thermal *tz)
456 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 436 acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
457 tz->trips.critical.flags.enabled); 437 tz->trips.critical.flags.enabled);
458 438
459 acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF); 439 orderly_poweroff(true);
460 440
461 return 0; 441 return 0;
462} 442}