Skip to content

Commit

Permalink
platform/x86: thinkpad_acpi: Replace ifdef CONFIG_ACPI_PLATFORM_PROFI…
Browse files Browse the repository at this point in the history
…LE 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 <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
jwrdegoede committed Feb 4, 2021
1 parent d2386d7 commit 9aa422f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions drivers/platform/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ config THINKPAD_ACPI
depends on RFKILL || RFKILL = n
depends on ACPI_VIDEO || ACPI_VIDEO = n
depends on BACKLIGHT_CLASS_DEVICE
depends on ACPI_PLATFORM_PROFILE
select HWMON
select NVRAM
select NEW_LEDS
Expand Down
7 changes: 0 additions & 7 deletions drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9995,8 +9995,6 @@ static struct ibm_struct proxsensor_driver_data = {
.exit = proxsensor_exit,
};

#if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE)

/*************************************************************************
* DYTC Platform Profile interface
*/
Expand Down Expand Up @@ -10251,7 +10249,6 @@ static struct ibm_struct dytc_profile_driver_data = {
.name = "dytc-profile",
.exit = dytc_profile_exit,
};
#endif /* CONFIG_ACPI_PLATFORM_PROFILE */

/*************************************************************************
* Keyboard language interface
Expand Down Expand Up @@ -10476,11 +10473,9 @@ static void tpacpi_driver_event(const unsigned int hkey_event)

if (hkey_event == TP_HKEY_EV_THM_CSM_COMPLETED) {
lapsensor_refresh();
#if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE)
/* If we are already accessing DYTC then skip dytc update */
if (!atomic_add_unless(&dytc_ignore_event, -1, 0))
dytc_profile_refresh();
#endif
}
}

Expand Down Expand Up @@ -10924,12 +10919,10 @@ static struct ibm_init_struct ibms_init[] __initdata = {
.init = tpacpi_proxsensor_init,
.data = &proxsensor_driver_data,
},
#if IS_ENABLED(CONFIG_ACPI_PLATFORM_PROFILE)
{
.init = tpacpi_dytc_profile_init,
.data = &dytc_profile_driver_data,
},
#endif
{
.init = tpacpi_kbdlang_init,
.data = &kbdlang_driver_data,
Expand Down

0 comments on commit 9aa422f

Please sign in to comment.