[coreboot-gerrit] New patch to review for coreboot: 5144ee0 libpayload udc: Only enable configuration if it's valid

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Fri Apr 17 13:16:17 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9789

-gerrit

commit 5144ee056639cc7408e7830f78c51594d7946bc6
Author: Patrick Georgi <pgeorgi at google.com>
Date:   Tue Mar 10 12:57:11 2015 +0100

    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 at chromium.org>
    Original-Commit-Id: 7119829096b444b790937b116fb782bcb5da70cd
    Original-Change-Id: If698b11a7ff7688def310d8574fcfa7a40f703c1
    Original-Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/258063
    Original-Reviewed-by: Furquan Shaikh <furquan at chromium.org>
---
 payloads/libpayload/drivers/udc/udc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/payloads/libpayload/drivers/udc/udc.c b/payloads/libpayload/drivers/udc/udc.c
index 9694ff8..23c319b 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;



More information about the coreboot-gerrit mailing list