Ethernet gadget driver can be used both by both SPL and u-boot. Since
usb_eth_init() is the entry point for ethernet gadget driver, perform
board initialization there. Also perform the cleanup in usb_eth_halt.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
#include <linux/usb/cdc.h>
#include <linux/usb/gadget.h>
#include <net.h>
+#include <usb.h>
#include <malloc.h>
#include <linux/ctype.h>
goto fail;
}
+ board_usb_init(0, USB_INIT_DEVICE);
+
/* Configure default mac-addresses for the USB ethernet device */
#ifdef CONFIG_USBNET_DEV_ADDR
strlcpy(dev_addr, CONFIG_USBNET_DEV_ADDR, sizeof(dev_addr));
}
usb_gadget_unregister_driver(ð_driver);
+ board_usb_cleanup(0, USB_INIT_DEVICE);
}
static struct usb_gadget_driver eth_driver = {