Skip to content

Commit 52572cd

Browse files
arndbJiri Kosina
authored andcommitted
HID: lenovo: select CONFIG_ACPI_PLATFORM_PROFILE
A previous patch tried to fix this link failure: x86_64-linux-ld: drivers/hid/hid-lenovo.o: in function `lenovo_raw_event': hid-lenovo.c:(.text+0x22c): undefined reference to `platform_profile_cycle' but got it wrong in three ways: - the link failure still exists with CONFIG_ACPI_PLATFORM_PROFILE=m when hid-lenovo is built-in - There is no way to manually enable CONFIG_ACPI_PLATFORM_PROFILE, as it is intended to be selected by its users. Remove the broken #if check again and instead select the symbol like the other users do. This requires adding a dependency on CONFIG_ACPI. Fixes: 52e7d1f ("HID: lenovo: Fix undefined platform_profile_cycle in ThinkPad X12 keyboard patch") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 7e0d1cf commit 52572cd

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

drivers/hid/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ config HID_LED
570570

571571
config HID_LENOVO
572572
tristate "Lenovo / Thinkpad devices"
573+
depends on ACPI
574+
select ACPI_PLATFORM_PROFILE
573575
select NEW_LEDS
574576
select LEDS_CLASS
575577
help

drivers/hid/hid-lenovo.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
#include <linux/leds.h>
3333
#include <linux/workqueue.h>
3434

35-
#if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE)
3635
#include <linux/platform_profile.h>
37-
#endif /* CONFIG_ACPI_PLATFORM_PROFILE */
3836

3937
#include "hid-ids.h"
4038

@@ -730,13 +728,10 @@ static int lenovo_raw_event_TP_X12_tab(struct hid_device *hdev, u32 raw_data)
730728
if (hdev->product == USB_DEVICE_ID_LENOVO_X12_TAB) {
731729
report_key_event(input, KEY_RFKILL);
732730
return 1;
733-
}
734-
#if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE)
735-
else {
731+
} else {
736732
platform_profile_cycle();
737733
return 1;
738734
}
739-
#endif /* CONFIG_ACPI_PLATFORM_PROFILE */
740735
return 0;
741736
case TP_X12_RAW_HOTKEY_FN_F10:
742737
/* TAB1 has PICKUP Phone and TAB2 use Snipping tool*/

0 commit comments

Comments
 (0)