Skip to content

Commit 2de5bba

Browse files
arndbgregkh
authored andcommitted
usb: fotg210: fix OTG-only build
The fotg210 module combines the HCD and OTG drivers, which then fails to build when only the USB gadget support is enabled in the kernel but host support is not: aarch64-linux-ld: drivers/usb/fotg210/fotg210-core.o: in function `fotg210_init': fotg210-core.c:(.init.text+0xc): undefined reference to `usb_disabled' Move the check for usb_disabled() after the check for the HCD module, and let the OTG driver still be probed in this configuration. A nicer approach might be to have the common portion built as a library module, with the two platform other files registering their own platform_driver instances separately. Fixes: ddacd6e ("usb: fotg210: Fix Kconfig for USB host modules") Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b659b61 commit 2de5bba

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/usb/fotg210/fotg210-core.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ static struct platform_driver fotg210_driver = {
144144

145145
static int __init fotg210_init(void)
146146
{
147-
if (usb_disabled())
148-
return -ENODEV;
149-
150-
if (IS_ENABLED(CONFIG_USB_FOTG210_HCD))
147+
if (IS_ENABLED(CONFIG_USB_FOTG210_HCD) && !usb_disabled())
151148
fotg210_hcd_init();
152149
return platform_driver_register(&fotg210_driver);
153150
}

0 commit comments

Comments
 (0)