Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185078
b: refs/heads/master
c: b589ea4
h: refs/heads/master
v: v3
  • Loading branch information
Henrique de Moraes Holschuh committed Feb 26, 2010
1 parent 3a1e2a4 commit e97d81c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 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: 7d1894d8d1c411d2dad95abfe0f65bacf68c4afa
refs/heads/master: b589ea4c44170d3f7a845684e2d1b3b9571663af
15 changes: 6 additions & 9 deletions trunk/drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2607,16 +2607,11 @@ static int hotkey_inputdev_open(struct input_dev *dev)
{
switch (tpacpi_lifecycle) {
case TPACPI_LIFE_INIT:
/*
* hotkey_init will call hotkey_poll_setup_safe
* at the appropriate moment
*/
return 0;
case TPACPI_LIFE_EXITING:
return -EBUSY;
case TPACPI_LIFE_RUNNING:
hotkey_poll_setup_safe(false);
return 0;
case TPACPI_LIFE_EXITING:
return -EBUSY;
}

/* Should only happen if tpacpi_lifecycle is corrupt */
Expand All @@ -2627,7 +2622,7 @@ static int hotkey_inputdev_open(struct input_dev *dev)
static void hotkey_inputdev_close(struct input_dev *dev)
{
/* disable hotkey polling when possible */
if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING &&
if (tpacpi_lifecycle != TPACPI_LIFE_EXITING &&
!(hotkey_source_mask & hotkey_driver_mask))
hotkey_poll_setup_safe(false);
}
Expand Down Expand Up @@ -9038,6 +9033,9 @@ static int __init thinkpad_acpi_module_init(void)
return ret;
}
}

tpacpi_lifecycle = TPACPI_LIFE_RUNNING;

ret = input_register_device(tpacpi_inputdev);
if (ret < 0) {
printk(TPACPI_ERR "unable to register input device\n");
Expand All @@ -9047,7 +9045,6 @@ static int __init thinkpad_acpi_module_init(void)
tp_features.input_device_registered = 1;
}

tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
return 0;
}

Expand Down

0 comments on commit e97d81c

Please sign in to comment.