Add patches accepted for 2.6.30-rc4
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.30-rc4 / 0001-thinkpad-acpi-silence-hotkey-enable-warning-for-mod.patch
blob9a831f91ba6d7f440bf6de360a28d509a4b3dd76
1 From 406e988bef742aa74cdc1f5fafc812ecebf7c02b Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Tue, 14 Apr 2009 02:44:10 +0000
4 Subject: thinkpad-acpi: silence hotkey enable warning for module parameter
6 Avoid the WARN() when the procfs handler for hotkey enable is used by
7 a module parameter. Instead, urge the user to stop doing that.
9 Reported-by: Niel Lambrechts <niel.lambrechts@gmail.com>
10 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
11 Signed-off-by: Len Brown <len.brown@intel.com>
12 ---
13 drivers/platform/x86/thinkpad_acpi.c | 18 ++++++++++++------
14 1 files changed, 12 insertions(+), 6 deletions(-)
16 diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
17 index a40b075..a186c5b 100644
18 --- a/drivers/platform/x86/thinkpad_acpi.c
19 +++ b/drivers/platform/x86/thinkpad_acpi.c
20 @@ -2946,12 +2946,18 @@ static int hotkey_read(char *p)
21 return len;
24 -static void hotkey_enabledisable_warn(void)
25 +static void hotkey_enabledisable_warn(bool enable)
27 tpacpi_log_usertask("procfs hotkey enable/disable");
28 - WARN(1, TPACPI_WARN
29 - "hotkey enable/disable functionality has been "
30 - "removed from the driver. Hotkeys are always enabled.\n");
31 + if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable),
32 + TPACPI_WARN
33 + "hotkey enable/disable functionality has been "
34 + "removed from the driver. Hotkeys are always "
35 + "enabled\n"))
36 + printk(TPACPI_ERR
37 + "Please remove the hotkey=enable module "
38 + "parameter, it is deprecated. Hotkeys are always "
39 + "enabled\n");
42 static int hotkey_write(char *buf)
43 @@ -2971,9 +2977,9 @@ static int hotkey_write(char *buf)
44 res = 0;
45 while ((cmd = next_cmd(&buf))) {
46 if (strlencmp(cmd, "enable") == 0) {
47 - hotkey_enabledisable_warn();
48 + hotkey_enabledisable_warn(1);
49 } else if (strlencmp(cmd, "disable") == 0) {
50 - hotkey_enabledisable_warn();
51 + hotkey_enabledisable_warn(0);
52 res = -EPERM;
53 } else if (strlencmp(cmd, "reset") == 0) {
54 mask = hotkey_orig_mask;
55 --
56 1.6.2.3