diff options
| author | Tom Rini <trini@ti.com> | 2012-12-21 16:19:29 -0700 | 
|---|---|---|
| committer | Tom Rini <trini@ti.com> | 2012-12-21 16:19:29 -0700 | 
| commit | ba6d4b64b33146740a15b3dd5a5f511a2bc8d6f6 (patch) | |
| tree | c57eeb10d2b625a1052cb523e6dd53d067b1bb65 /common/usb.c | |
| parent | ba427678a419a59c091e1c816c13852fa05b24bf (diff) | |
| parent | 41984e71231c7af4a5617f4f94f372714c64d987 (diff) | |
| download | olio-uboot-2014.01-ba6d4b64b33146740a15b3dd5a5f511a2bc8d6f6.tar.xz olio-uboot-2014.01-ba6d4b64b33146740a15b3dd5a5f511a2bc8d6f6.zip  | |
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'common/usb.c')
| -rw-r--r-- | common/usb.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/common/usb.c b/common/usb.c index ac9b4ca8d..6fc0fc1c0 100644 --- a/common/usb.c +++ b/common/usb.c @@ -805,6 +805,18 @@ struct usb_device *usb_alloc_new_device(void *controller)  	return &usb_dev[dev_index - 1];  } +/* + * Free the newly created device node. + * Called in error cases where configuring a newly attached + * device fails for some reason. + */ +void usb_free_device(void) +{ +	dev_index--; +	USB_PRINTF("Freeing device node: %d\n", dev_index); +	memset(&usb_dev[dev_index], 0, sizeof(struct usb_device)); +	usb_dev[dev_index].devnum = -1; +}  /*   * By the time we get here, the device has gotten a new device ID  |