Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: thinkpad_acpi: Replace ifdef CONFIG_ACPI_PLATFORM_PROFILE with depends on

With the #if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE), we get the following
errors when thinkpad_acpi is builtin while CONFIG_ACPI_PLATFORM_PROFILE=m :

drivers/platform/x86/thinkpad_acpi.c:10186: undefined reference to `platform_profile_notify'
drivers/platform/x86/thinkpad_acpi.c:10226: undefined reference to `platform_profile_register'
drivers/platform/x86/thinkpad_acpi.c:10246: undefined reference to `platform_profile_remove'

This could be fixed by changing the IS_ENABLED to IS_REACHABLE, but
I believe that it is better to just switch to using depends on.

Using depends on ensures that platform-profile support is always
available when thinkpad_acpi is build, hopefully leading to less
confusing bug-reports about it sometimes not working.

Cc: Mark Pearson <markpearson@lenovo.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210204140158.268289-2-hdegoede@redhat.com

+1 -7
+1
drivers/platform/x86/Kconfig
··· 482 482 depends on RFKILL || RFKILL = n 483 483 depends on ACPI_VIDEO || ACPI_VIDEO = n 484 484 depends on BACKLIGHT_CLASS_DEVICE 485 + depends on ACPI_PLATFORM_PROFILE 485 486 select HWMON 486 487 select NVRAM 487 488 select NEW_LEDS
-7
drivers/platform/x86/thinkpad_acpi.c
··· 9995 9995 .exit = proxsensor_exit, 9996 9996 }; 9997 9997 9998 - #if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE) 9999 - 10000 9998 /************************************************************************* 10001 9999 * DYTC Platform Profile interface 10002 10000 */ ··· 10249 10251 .name = "dytc-profile", 10250 10252 .exit = dytc_profile_exit, 10251 10253 }; 10252 - #endif /* CONFIG_ACPI_PLATFORM_PROFILE */ 10253 10254 10254 10255 /************************************************************************* 10255 10256 * Keyboard language interface ··· 10473 10476 10474 10477 if (hkey_event == TP_HKEY_EV_THM_CSM_COMPLETED) { 10475 10478 lapsensor_refresh(); 10476 - #if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE) 10477 10479 /* If we are already accessing DYTC then skip dytc update */ 10478 10480 if (!atomic_add_unless(&dytc_ignore_event, -1, 0)) 10479 10481 dytc_profile_refresh(); 10480 - #endif 10481 10482 } 10482 10483 } 10483 10484 ··· 10919 10924 .init = tpacpi_proxsensor_init, 10920 10925 .data = &proxsensor_driver_data, 10921 10926 }, 10922 - #if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE) 10923 10927 { 10924 10928 .init = tpacpi_dytc_profile_init, 10925 10929 .data = &dytc_profile_driver_data, 10926 10930 }, 10927 - #endif 10928 10931 { 10929 10932 .init = tpacpi_kbdlang_init, 10930 10933 .data = &kbdlang_driver_data,