Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71613
b: refs/heads/master
c: 8fef502
h: refs/heads/master
i:
  71611: e786689
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Sep 24, 2007
1 parent 48b06f0 commit a14bc8a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8523ed6fb2ca04973fe759fda8ab4af72492fc7e
refs/heads/master: 8fef502e5a14df05f1e755edc9175e01c9814080
20 changes: 19 additions & 1 deletion trunk/drivers/misc/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ IBM_BIOS_MODULE_ALIAS("K[U,X-Z]");

#define __unused __attribute__ ((unused))

static enum {
TPACPI_LIFE_INIT = 0,
TPACPI_LIFE_RUNNING,
TPACPI_LIFE_EXITING,
} tpacpi_lifecycle;

/****************************************************************************
****************************************************************************
*
Expand Down Expand Up @@ -342,6 +348,9 @@ static void dispatch_acpi_notify(acpi_handle handle, u32 event, void *data)
{
struct ibm_struct *ibm = data;

if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING)
return;

if (!ibm || !ibm->acpi || !ibm->acpi->notify)
return;

Expand Down Expand Up @@ -3899,6 +3908,9 @@ static void fan_watchdog_fire(struct work_struct *ignored)
{
int rc;

if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING)
return;

printk(IBM_NOTICE "fan watchdog: enabling fan\n");
rc = fan_set_enable();
if (rc < 0) {
Expand All @@ -3919,7 +3931,8 @@ static void fan_watchdog_reset(void)
if (fan_watchdog_active)
cancel_delayed_work(&fan_watchdog_task);

if (fan_watchdog_maxinterval > 0) {
if (fan_watchdog_maxinterval > 0 &&
tpacpi_lifecycle != TPACPI_LIFE_EXITING) {
fan_watchdog_active = 1;
if (!schedule_delayed_work(&fan_watchdog_task,
msecs_to_jiffies(fan_watchdog_maxinterval
Expand Down Expand Up @@ -4685,6 +4698,8 @@ static int __init thinkpad_acpi_module_init(void)
{
int ret, i;

tpacpi_lifecycle = TPACPI_LIFE_INIT;

/* Parameter checking */
if (hotkey_report_mode > 2)
return -EINVAL;
Expand Down Expand Up @@ -4781,13 +4796,16 @@ static int __init thinkpad_acpi_module_init(void)
tp_features.input_device_registered = 1;
}

tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
return 0;
}

static void thinkpad_acpi_module_exit(void)
{
struct ibm_struct *ibm, *itmp;

tpacpi_lifecycle = TPACPI_LIFE_EXITING;

list_for_each_entry_safe_reverse(ibm, itmp,
&tpacpi_all_drivers,
all_drivers) {
Expand Down

0 comments on commit a14bc8a

Please sign in to comment.