sunxi: only init USB Ethernet gadget when it's enabled
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 <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index cb42742..6e13ee3 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -733,7 +733,9 @@
return ret;
#endif
+#ifdef CONFIG_USB_ETHER
usb_ether_init();
+#endif
return 0;
}