sunxi: only init USB Ethernet gadget when it's enabled
authorIcenowy Zheng <[email protected]>
Thu, 28 Sep 2017 14:16:38 +0000 (22:16 +0800)
committerMaxime Ripard <[email protected]>
Tue, 3 Oct 2017 17:12:06 +0000 (19:12 +0200)
If the USB Ethernet gadget is not yet enabled, the call of
usb_ether_init in board/sunxi/board.c will lead to undefined reference
error when building.

Fix this problem.

Fixes: 50ddbf1199a0 ("sunxi: Register usb_ether")
Signed-off-by: Icenowy Zheng <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
board/sunxi/board.c

index cb42742dd23b06688757219cbb3c699d8d190f9c..6e13ee32c14d7715739f2dcbdbbff4c54b839862 100644 (file)
@@ -733,7 +733,9 @@ int misc_init_r(void)
                return ret;
 #endif
 
+#ifdef CONFIG_USB_ETHER
        usb_ether_init();
+#endif
 
        return 0;
 }