Commit 406e988b authored by Henrique de Moraes Holschuh's avatar Henrique de Moraes Holschuh Committed by Len Brown
Browse files

thinkpad-acpi: silence hotkey enable warning for module parameter



Avoid the WARN() when the procfs handler for hotkey enable is used by
a module parameter.  Instead, urge the user to stop doing that.

Reported-by: default avatarNiel Lambrechts <niel.lambrechts@gmail.com>
Signed-off-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 0882e8dd
Loading
Loading
Loading
Loading
+12 −6
Original line number Original line Diff line number Diff line
@@ -2946,12 +2946,18 @@ static int hotkey_read(char *p)
	return len;
	return len;
}
}


static void hotkey_enabledisable_warn(void)
static void hotkey_enabledisable_warn(bool enable)
{
{
	tpacpi_log_usertask("procfs hotkey enable/disable");
	tpacpi_log_usertask("procfs hotkey enable/disable");
	WARN(1, TPACPI_WARN
	if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable),
			TPACPI_WARN
			"hotkey enable/disable functionality has been "
			"hotkey enable/disable functionality has been "
	     "removed from the driver. Hotkeys are always enabled.\n");
			"removed from the driver.  Hotkeys are always "
			"enabled\n"))
		printk(TPACPI_ERR
			"Please remove the hotkey=enable module "
			"parameter, it is deprecated.  Hotkeys are always "
			"enabled\n");
}
}


static int hotkey_write(char *buf)
static int hotkey_write(char *buf)
@@ -2971,9 +2977,9 @@ static int hotkey_write(char *buf)
	res = 0;
	res = 0;
	while ((cmd = next_cmd(&buf))) {
	while ((cmd = next_cmd(&buf))) {
		if (strlencmp(cmd, "enable") == 0) {
		if (strlencmp(cmd, "enable") == 0) {
			hotkey_enabledisable_warn();
			hotkey_enabledisable_warn(1);
		} else if (strlencmp(cmd, "disable") == 0) {
		} else if (strlencmp(cmd, "disable") == 0) {
			hotkey_enabledisable_warn();
			hotkey_enabledisable_warn(0);
			res = -EPERM;
			res = -EPERM;
		} else if (strlencmp(cmd, "reset") == 0) {
		} else if (strlencmp(cmd, "reset") == 0) {
			mask = hotkey_orig_mask;
			mask = hotkey_orig_mask;