Skip to contentSkip to conversation

usb: musb: fix dead select of USB_MUSB_DUAL_ROLE

PATCH Superseded Julian Braha 3 participants 5 messages Jul 11 – Jul 13

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: musb: fix dead select of USB_MUSB_DUAL_ROLE

'select' does not work on config options in a 'choice', so currently it is possible to enable USB_MUSB_POLARFIRE_SOC without USB_MUSB_DUAL_ROLE.

Replace 'select' with 'depends on'.

This dead select was found by kconfirm, a static analysis tool for Kconfig.

---
 drivers/usb/musb/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/musb/Kconfig +1 -1
index f56929267eaa..f8ff2366f59f 100644
@@ -116,7 +116,7 @@ config USB_MUSB_POLARFIRE_SOC
 	tristate "Microchip PolarFire SoC platforms"
 	depends on ARCH_MICROCHIP_POLARFIRE || COMPILE_TEST
 	depends on NOP_USB_XCEIV
-	select USB_MUSB_DUAL_ROLE
+	depends on USB_MUSB_DUAL_ROLE
 	help
 	  Say Y here to enable support for USB on Microchip's PolarFire SoC.
 
Signature · 1 line
2.54.0
#1 lore raw
Quoted 8 lines · Julian Braha

'select' does not work on config options in a 'choice', so currently it is possible to enable USB_MUSB_POLARFIRE_SOC without USB_MUSB_DUAL_ROLE.

Replace 'select' with 'depends on'.

This dead select was found by kconfirm, a static analysis tool for Kconfig.

Good catch, but I wonder if this is actually a real dependency at all. What would happen if you just remove the 'select' line here and build a polarfire kernel that only supports host or gadget mode but not dual-role?

Arnd

#2 lore raw

Hi Arnd,

Quoted 4 lines · Arnd Bergmann

Good catch, but I wonder if this is actually a real dependency at all. What would happen if you just remove the 'select' line here and build a polarfire kernel that only supports host or gadget mode but not dual-role?

The kernel builds just fine for me with USB_MUSB_POLARFIRE_SOC=y and USB_MUSB_DUAL_ROLE=n

But I don't have this hardware so I don't know what would happen at runtime.

I've CC'd more people involved in patches to this config option.

- Julian Braha

#3 lore raw
Quoted 8 lines · Julian Braha

Hi Arnd,

Quoted 4 lines · Arnd Bergmann

Good catch, but I wonder if this is actually a real dependency at all. What would happen if you just remove the 'select' line here and build a polarfire kernel that only supports host or gadget mode but not dual-role?

Quoted 7 lines

The kernel builds just fine for me with USB_MUSB_POLARFIRE_SOC=y and USB_MUSB_DUAL_ROLE=n

But I don't have this hardware so I don't know what would happen at runtime.

I've CC'd more people involved in patches to this config option.

This is the setup I've been using in my development environment for (probably) years.

Probably the select should just be deleted.

#4 lore raw
Quoted 7 lines · Conor Dooley
Quoted 6 lines · Julian Braha
Quoted 4 lines · Arnd Bergmann

Good catch, but I wonder if this is actually a real dependency at all. What would happen if you just remove the 'select' line here and build a polarfire kernel that only supports host or gadget mode but not dual-role?

Quoted 7 lines
Quoted 3 lines

The kernel builds just fine for me with USB_MUSB_POLARFIRE_SOC=y and USB_MUSB_DUAL_ROLE=n

This is the setup I've been using in my development environment for (probably) years.

Probably the select should just be deleted.

Ok, so it was probably just a misguided attempt to pick the most useful configuration by default.

Julian, can you send a new patch to just drop the line?

Arnd