diff options
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a40b075743d9..a186c5bbdcd9 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -2946,12 +2946,18 @@ static int hotkey_read(char *p) | |||
2946 | return len; | 2946 | return len; |
2947 | } | 2947 | } |
2948 | 2948 | ||
2949 | static void hotkey_enabledisable_warn(void) | 2949 | static void hotkey_enabledisable_warn(bool enable) |
2950 | { | 2950 | { |
2951 | tpacpi_log_usertask("procfs hotkey enable/disable"); | 2951 | tpacpi_log_usertask("procfs hotkey enable/disable"); |
2952 | WARN(1, TPACPI_WARN | 2952 | if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable), |
2953 | "hotkey enable/disable functionality has been " | 2953 | TPACPI_WARN |
2954 | "removed from the driver. Hotkeys are always enabled.\n"); | 2954 | "hotkey enable/disable functionality has been " |
2955 | "removed from the driver. Hotkeys are always " | ||
2956 | "enabled\n")) | ||
2957 | printk(TPACPI_ERR | ||
2958 | "Please remove the hotkey=enable module " | ||
2959 | "parameter, it is deprecated. Hotkeys are always " | ||
2960 | "enabled\n"); | ||
2955 | } | 2961 | } |
2956 | 2962 | ||
2957 | static int hotkey_write(char *buf) | 2963 | static int hotkey_write(char *buf) |
@@ -2971,9 +2977,9 @@ static int hotkey_write(char *buf) | |||
2971 | res = 0; | 2977 | res = 0; |
2972 | while ((cmd = next_cmd(&buf))) { | 2978 | while ((cmd = next_cmd(&buf))) { |
2973 | if (strlencmp(cmd, "enable") == 0) { | 2979 | if (strlencmp(cmd, "enable") == 0) { |
2974 | hotkey_enabledisable_warn(); | 2980 | hotkey_enabledisable_warn(1); |
2975 | } else if (strlencmp(cmd, "disable") == 0) { | 2981 | } else if (strlencmp(cmd, "disable") == 0) { |
2976 | hotkey_enabledisable_warn(); | 2982 | hotkey_enabledisable_warn(0); |
2977 | res = -EPERM; | 2983 | res = -EPERM; |
2978 | } else if (strlencmp(cmd, "reset") == 0) { | 2984 | } else if (strlencmp(cmd, "reset") == 0) { |
2979 | mask = hotkey_orig_mask; | 2985 | mask = hotkey_orig_mask; |