diff options
author | Patrick Georgi <pgeorgi@google.com> | 2015-03-10 12:57:11 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-18 08:42:22 +0200 |
commit | dc83d35da37e62e7b8c699013f870ebc883766b6 (patch) | |
tree | a7b3c1268444bcb34111237c2b49604d8d04ff88 /payloads/libpayload | |
parent | e17d57ecabe02d0c95ebe0f41c7e1fee5f2804c9 (diff) |
libpayload udc: Only enable configuration if it's valid
Only set internal variables when there's no risk of breaking things.
BRANCH=none
BUG=none
TEST=none
Change-Id: I8a8b63f60bdb70fad38130ce38eef81fe3725aa2
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 7119829096b444b790937b116fb782bcb5da70cd
Original-Change-Id: If698b11a7ff7688def310d8574fcfa7a40f703c1
Original-Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/258063
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9789
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r-- | payloads/libpayload/drivers/udc/udc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/payloads/libpayload/drivers/udc/udc.c b/payloads/libpayload/drivers/udc/udc.c index 9694ff8ec1..23c319bbe4 100644 --- a/payloads/libpayload/drivers/udc/udc.c +++ b/payloads/libpayload/drivers/udc/udc.c @@ -142,9 +142,6 @@ static int setup_ep0(struct usbdev_ctrl *this, dev_req_t *dr) struct usbdev_configuration *config = fetch_config(this, dr->wValue); - this->current_config = config; - this->current_config_id = dr->wValue; - if (dr->wValue == 0) cease_operation(this); @@ -157,7 +154,10 @@ static int setup_ep0(struct usbdev_ctrl *this, dev_req_t *dr) /* status phase IN */ this->enqueue_packet(this, 0, 1, NULL, 0, 0, 0); - /* automatically configure endpoints in interface 0 */ + this->current_config = config; + this->current_config_id = dr->wValue; + + /* activate first interface */ enable_interface(this, 0); this->initialized = 1; return 1; |