Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4be73005 authored by Henrique de Moraes Holschuh's avatar Henrique de Moraes Holschuh Committed by Len Brown
Browse files

thinkpad-acpi: remove uneeded tp_features.hotkey tests in hotkey_exit



hotkey_exit() is only called if hotkey_init() finished sucessfully, or
by direct calls inside hotkey_init().  The tp_features.hotkey test is
always true, and just adds to the confusion, remove it.  Also, avoid
calling hotkey_mask_set() when it won't do anything useful.

Signed-off-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 435c47e2
Loading
Loading
Loading
Loading
+8 −10
Original line number Original line Diff line number Diff line
@@ -2843,17 +2843,15 @@ static void hotkey_exit(void)


	kfree(hotkey_keycode_map);
	kfree(hotkey_keycode_map);


	if (tp_features.hotkey) {
	dbg_printk(TPACPI_DBG_EXIT | TPACPI_DBG_HKEY,
	dbg_printk(TPACPI_DBG_EXIT | TPACPI_DBG_HKEY,
		   "restoring original hot key mask\n");
		   "restoring original hot key mask\n");
	/* no short-circuit boolean operator below! */
	/* no short-circuit boolean operator below! */
		if ((hotkey_mask_set(hotkey_orig_mask) |
	if (((tp_features.hotkey_mask && hotkey_mask_set(hotkey_orig_mask))
		     hotkey_status_set(false)) != 0)
	     | hotkey_status_set(false)) != 0)
		printk(TPACPI_ERR
		printk(TPACPI_ERR
		       "failed to restore hot key mask "
		       "failed to restore hot key mask "
		       "to BIOS defaults\n");
		       "to BIOS defaults\n");
}
}
}


static void __init hotkey_unmap(const unsigned int scancode)
static void __init hotkey_unmap(const unsigned int scancode)
{
{