summaryrefslogtreecommitdiffstats
path: root/common/usb.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2012-12-21 16:19:29 -0700
committerTom Rini <trini@ti.com>2012-12-21 16:19:29 -0700
commitba6d4b64b33146740a15b3dd5a5f511a2bc8d6f6 (patch)
treec57eeb10d2b625a1052cb523e6dd53d067b1bb65 /common/usb.c
parentba427678a419a59c091e1c816c13852fa05b24bf (diff)
parent41984e71231c7af4a5617f4f94f372714c64d987 (diff)
downloadblackbird-obmc-uboot-ba6d4b64b33146740a15b3dd5a5f511a2bc8d6f6.tar.gz
blackbird-obmc-uboot-ba6d4b64b33146740a15b3dd5a5f511a2bc8d6f6.zip
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'common/usb.c')
-rw-r--r--common/usb.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/usb.c b/common/usb.c
index ac9b4ca8d5..6fc0fc1c0e 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
OpenPOWER on IntegriCloud