Skip to contentSkip to conversation

platform: dell: all DELL_WMI driver options depend on DELL_WMI

PATCH In review Randy Dunlap 2 participants 3 messages Sep 27, 2021 – Oct 11, 2021 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform: dell: all DELL_WMI driver options depend on DELL_WMI

A randconfig or a user can set/enable DELL_WMI_PRIVACY even when DELL_WMI is not enabled. This leads to a build error in dell-laptop.o:

ld: drivers/platform/x86/dell/dell-laptop.o: in function `dell_init':
dell-laptop.c:(.init.text+0x719): undefined reference to `dell_privacy_has_mic_mute'

Fix this by enclosing the DELL_WMI driver options inside a if DELL_WMI / endif bracket.

---
Found in linux-next, applies to mainline.

The last time that I sent a patch to Perry Yuan (about 2 weeks ago), it bounced...

 drivers/platform/x86/dell/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/dell/Kconfig +4 -0
@@ -164,6 +164,8 @@ config DELL_WMI
 	  To compile this driver as a module, choose M here: the module will
 	  be called dell-wmi.
 
+if DELL_WMI
+
 config DELL_WMI_PRIVACY
 	bool "Dell WMI Hardware Privacy Support"
 	depends on LEDS_TRIGGER_AUDIO = y || DELL_WMI = LEDS_TRIGGER_AUDIO
@@ -198,6 +200,8 @@ config DELL_WMI_LED
 	  This adds support for the Latitude 2100 and similar
 	  notebooks that have an external LED.
 
+endif # DELL_WMI
+
 config DELL_WMI_SYSMAN
 	tristate "Dell WMI-based Systems management driver"
 	default m
#1 lore raw

Still seeing this build error in linux-next, so the patch is still needed...

Quoted 46 lines · Randy Dunlap

A randconfig or a user can set/enable DELL_WMI_PRIVACY even when DELL_WMI is not enabled. This leads to a build error in dell-laptop.o:

ld: drivers/platform/x86/dell/dell-laptop.o: in function `dell_init':
dell-laptop.c:(.init.text+0x719): undefined reference to `dell_privacy_has_mic_mute'

Fix this by enclosing the DELL_WMI driver options inside a if DELL_WMI / endif bracket.

---
Found in linux-next, applies to mainline.

The last time that I sent a patch to Perry Yuan (about 2 weeks ago), it bounced...

  drivers/platform/x86/dell/Kconfig |    4 ++++
  1 file changed, 4 insertions(+)
drivers/platform/x86/dell/Kconfig +4 -0
@@ -164,6 +164,8 @@ config DELL_WMI
  	  To compile this driver as a module, choose M here: the module will
  	  be called dell-wmi.
 
+if DELL_WMI
+
  config DELL_WMI_PRIVACY
  	bool "Dell WMI Hardware Privacy Support"
  	depends on LEDS_TRIGGER_AUDIO = y || DELL_WMI = LEDS_TRIGGER_AUDIO
@@ -198,6 +200,8 @@ config DELL_WMI_LED
  	  This adds support for the Latitude 2100 and similar
  	  notebooks that have an external LED.
 
+endif # DELL_WMI
+
  config DELL_WMI_SYSMAN
  	tristate "Dell WMI-based Systems management driver"
  	default m
Signature · 1 line
~Randy
#2 lore raw
In reply to Randy Dunlap

Hi Randy,

Quoted 16 lines · Randy Dunlap

A randconfig or a user can set/enable DELL_WMI_PRIVACY even when DELL_WMI is not enabled. This leads to a build error in dell-laptop.o:

ld: drivers/platform/x86/dell/dell-laptop.o: in function `dell_init':
dell-laptop.c:(.init.text+0x719): undefined reference to `dell_privacy_has_mic_mute'

Fix this by enclosing the DELL_WMI driver options inside a if DELL_WMI / endif bracket.

Quoted 5 lines

---
Found in linux-next, applies to mainline.

The last time that I sent a patch to Perry Yuan (about 2 weeks ago), it bounced...

Thank you for your patch, comments inline.

drivers/platform/x86/dell/Kconfig config DELL_WMI · line 168

Quoted 12 lines
 drivers/platform/x86/dell/Kconfig |    4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/dell/Kconfig +2 -0
@@ -164,6 +164,8 @@ config DELL_WMI
 	  To compile this driver as a module, choose M here: the module will
 	  be called dell-wmi.
 
+if DELL_WMI
+

Adding depends on DELL_WMI to DELL_WMI_PRIVACY definitely is the right thing to do, since DELL_WMI_PRIVACY is intended as a feature toggle for the main dell-wmi driver.

drivers/platform/x86/dell/Kconfig config DELL_WMI_LED · line 204

Quoted 9 lines
drivers/platform/x86/dell/Kconfig +2 -0
 config DELL_WMI_PRIVACY
 	bool "Dell WMI Hardware Privacy Support"
 	depends on LEDS_TRIGGER_AUDIO = y || DELL_WMI = LEDS_TRIGGER_AUDIO
@@ -198,6 +200,8 @@ config DELL_WMI_LED
 	  This adds support for the Latitude 2100 and similar
 	  notebooks that have an external LED.
 
+endif # DELL_WMI
+

But also adding it to DELL_WMI_AIO, DELL_WMI_DESCRIPTOR and DELL_WMI_LED is wrong, the _AIO and _LED options are independent and the DELL_WMI_DESCRIPTOR option enables building of a helper lib which is e.g. also selected by DELL_SMBIOS_WMI.

I'll prepare a new fix adding the depends on to just DELL_WMI_PRIVACY, adding you (Randy) as Reported-by. I'll merge that right after sending it out for the archives, resolving this.

Regards,

Hans

Quoted 4 lines
drivers/platform/x86/dell/Kconfig +0 -0
 config DELL_WMI_SYSMAN
 	tristate "Dell WMI-based Systems management driver"
 	default m