summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2018-07-16 09:21:10 -0600
committerMartin Roth <martinroth@google.com>2018-07-17 15:23:36 +0000
commitc534a066d8808e97eee9ccd2ac2bc936961a129b (patch)
tree0a7fda176c889e92a5923ca148c8b95d01d2a367 /payloads/libpayload/drivers
parente73e81d02928a9b369861e996eaf4c5c64d76cc2 (diff)
downloadcoreboot-c534a066d8808e97eee9ccd2ac2bc936961a129b.tar.xz
libpayload: Add UNKNOWN_SPEED to usb_speed enum
xhci_rh_port_speed return -1 if the port is disabled. The usb_speed enum is unsigned so this results in a positive value which implies success. Adding a -1 to the enum will make it signed so the >= 0 check will work correctly. BUG=b:76831439 TEST=verified on grunt that -1 is returned when port is disabled. Change-Id: I98a373717d52dfb6ca4dcc53a00dc1b4c240a919 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://review.coreboot.org/27476 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r--payloads/libpayload/drivers/usb/xhci_rh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/usb/xhci_rh.c b/payloads/libpayload/drivers/usb/xhci_rh.c
index d7ba82c56a..ddf6ce80a4 100644
--- a/payloads/libpayload/drivers/usb/xhci_rh.c
+++ b/payloads/libpayload/drivers/usb/xhci_rh.c
@@ -95,7 +95,7 @@ xhci_rh_port_speed(usbdev_t *const dev, const int port)
>> PORTSC_PORT_SPEED_START)
- 1;
} else {
- return -1;
+ return UNKNOWN_SPEED;
}
}