usb: fotg210: fix link error for CONFIG_USB=n
Subsystems (2)
PATCH 1/1 usb: fotg210: fix link error for CONFIG_USB=n
From: Arnd Bergmann <[email protected]>
Calling usb_hcd_platform_shutdown() is not possible if CONFIG_USB is disabled:
arm-linux-gnueabi-ld: drivers/usb/fotg210/fotg210-core.o: in function `fotg210_shutdown':
fotg210-core.c:(.text+0x40): undefined reference to `usb_hcd_platform_shutdown'
Move this call into the hcd file to ensure this is only used when USB host mode is actually available.
--- drivers/usb/fotg210/fotg210-core.c | 2 +- drivers/usb/fotg210/fotg210-hcd.c | 5 +++++ drivers/usb/fotg210/fotg210.h | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/usb/fotg210/fotg210-core.c +1 -1
@@ -259,7 +259,7 @@ static void fotg210_remove(struct platform_device *pdev)static void fotg210_shutdown (struct platform_device *pdev) {if (usb_get_dr_mode (&pdev->dev) !=USB_DR_MODE_PERIPHERAL ) -usb_hcd_platform_shutdown (pdev); +fotg210_hcd_shutdown (pdev); }static int fotg210_suspend (struct device *dev)
drivers/usb/fotg210/fotg210-hcd.c +5 -0
@@ -186,6 +186,11 @@ int fotg210_hcd_remove(struct platform_device *pdev)return 0 ; } +void fotg210_hcd_shutdown (struct platform_device *pdev) +{ +usb_hcd_platform_shutdown (pdev); +} +int fotg210_hcd_suspend (struct device *dev) {#ifdef CONFIG_PM
drivers/usb/fotg210/fotg210.h +5 -0
@@ -26,6 +26,7 @@ void fotg210_vbus(struct fotg210 *fotg, bool enable);#ifdef CONFIG_USB_FOTG210_HCD int fotg210_hcd_probe (struct platform_device *pdev,struct fotg210 *fotg);int fotg210_hcd_remove (struct platform_device *pdev); +void fotg210_hcd_shutdown (struct platform_device *pdev);int fotg210_hcd_suspend (struct device *dev);int fotg210_hcd_resume (struct device *dev);int fotg210_hcd_init (void );
@@ -42,6 +43,10 @@ static inline int fotg210_hcd_remove(struct platform_device *pdev)return -ENODEV ; } +static inline void fotg210_hcd_shutdown (struct platform_device *pdev) +{ +} +static inline int fotg210_hcd_suspend (struct device *dev) {return -ENODEV ;
Signature · 1 line
2.53.0
Quoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Calling
usb_hcd_platform_shutdown()is not possible ifCONFIG_USBis disabled:
Quoted 8 lines
arm-linux-gnueabi-ld:
drivers/usb/fotg210/fotg210-core.o: in function `fotg210_shutdown':
fotg210-core.c:(.text+0x40): undefined reference to `usb_hcd_platform_shutdown'Move this call into the hcd file to ensure this is only used when USB host mode is actually available.
Fixes 7dbc2e1ba8fd ("usb: fotg210: use the common EHCI core")Signed-off-by Arnd Bergmann <[email protected]>
Good catch!
Yours,
Linus Walleij
Quoted 10 lines · Linus Walleij
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Calling
usb_hcd_platform_shutdown()is not possible ifCONFIG_USBis disabled:arm-linux-gnueabi-ld:
drivers/usb/fotg210/fotg210-core.o: in function `fotg210_shutdown':
fotg210-core.c:(.text+0x40): undefined reference to `usb_hcd_platform_shutdown'
Quoted 8 lines
Quoted 5 lines
Move this call into the hcd file to ensure this is only used when USB host mode is actually available.
Fixes 7dbc2e1ba8fd ("usb: fotg210: use the common EHCI core")Signed-off-by Arnd Bergmann <[email protected]>Good catch!
Reviewed-by Linus Walleij <[email protected]>
Apparently you you already fixed this yourself in commit 600334ef2f29 ("usb: fotg210: guard host shutdown in gadget-only builds") in today's linux-next, so this one is no longer needed, the two patches are equivalent.
I did run into an unrelated problem with fotg210 now, and I'll send a patch for that.
Arnd
Linus Walleij
maintainerQuoted 18 lines · Arnd Bergmann
Quoted 16 lines · Linus Walleij
Quoted 13 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Calling
usb_hcd_platform_shutdown()is not possible ifCONFIG_USBis disabled:arm-linux-gnueabi-ld:
drivers/usb/fotg210/fotg210-core.o: in function `fotg210_shutdown':
fotg210-core.c:(.text+0x40): undefined reference to `usb_hcd_platform_shutdown'Move this call into the hcd file to ensure this is only used when USB host mode is actually available.
Fixes 7dbc2e1ba8fd ("usb: fotg210: use the common EHCI core")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 7 lines
Quoted 2 lines
Good catch!
Reviewed-by Linus Walleij <[email protected]>Apparently you you already fixed this yourself in commit
600334ef2f29("usb: fotg210: guard host shutdown in gadget-only builds") in today's linux-next, so this one is no longer needed, the two patches are equivalent.
Haha the solution was so different that I didn't understand it was the same problem :D
Yours,
Linus Walleij