eth: remove usb-ethernet devices before re-enumerating them

Fix the crash when running several times usb_init() with a USB ethernet
device plugged.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Wolfgang Grandegger <wg@denx.de>
This commit is contained in:
Vincent Palatin 2012-01-09 08:32:36 +00:00 committed by Wolfgang Denk
parent e159e4868e
commit e7e982d69c
3 changed files with 35 additions and 2 deletions

View file

@ -96,6 +96,7 @@ struct eth_device {
extern int eth_initialize(bd_t *bis); /* Initialize network subsystem */
extern int eth_register(struct eth_device* dev);/* Register network device */
extern int eth_unregister(struct eth_device *dev);/* Remove network device */
extern void eth_try_another(int first_restart); /* Change the device */
extern void eth_set_current(void); /* set nterface to ethcur var */
extern struct eth_device *eth_get_dev(void); /* get the current device MAC */