diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 81f8ad6bb688..4a1dba3099a6 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -10047,6 +10047,13 @@ static int get_keyboard_lang(int *output) if (!acpi_evalf(gskl_handle, &kbd_lang, NULL, "dd", 0x02000000)) return -EIO; + /* + * METHOD_ERR gets returned on devices where there are no special (e.g. '=', + * '(' and ')') keys which use layout dependent key-press emulation. + */ + if (kbd_lang & METHOD_ERR) + return -ENODEV; + *output = kbd_lang; return 0;