usb: musb: fix dead select of USB_MUSB_DUAL_ROLE
Subsystems (2)
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
@@ -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
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_SOCwithoutUSB_MUSB_DUAL_ROLE.Replace 'select' with 'depends on'.
This dead select was found by kconfirm, a static analysis tool for
Kconfig.Signed-off-by Julian Braha <[email protected]>
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
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
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.
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