projects
/
coreboot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libpayload: style: compare null-pointers with NULL, not 0
[coreboot.git]
/
payloads
/
libpayload
/
drivers
/
usb
/
usb.c
diff --git
a/payloads/libpayload/drivers/usb/usb.c
b/payloads/libpayload/drivers/usb/usb.c
index 6995cef7b24afbf8193d4c301c159ca2c40bef31..1f21e6a9940d7716e7eadaf2adca6d13119714f4 100644
(file)
--- a/
payloads/libpayload/drivers/usb/usb.c
+++ b/
payloads/libpayload/drivers/usb/usb.c
@@
-67,6
+67,22
@@
detach_controller (hci_t *controller)
}
}
}
}
+/**
+ * Shut down all controllers
+ */
+int
+usb_exit (void)
+{
+ if (usb_hcs == 0)
+ return 0;
+ hci_t *controller = usb_hcs;
+ while (controller != NULL) {
+ controller->shutdown(controller);
+ controller = controller->next;
+ }
+ return 0;
+}
+
/**
* Polls all hubs on all USB controllers, to find out about device changes
*/
/**
* Polls all hubs on all USB controllers, to find out about device changes
*/
@@
-76,7
+92,7
@@
usb_poll (void)
if (usb_hcs == 0)
return;
hci_t *controller = usb_hcs;
if (usb_hcs == 0)
return;
hci_t *controller = usb_hcs;
- while (controller !=
0
) {
+ while (controller !=
NULL
) {
int i;
for (i = 0; i < 128; i++) {
if (controller->devices[i] != 0) {
int i;
for (i = 0; i < 128; i++) {
if (controller->devices[i] != 0) {
@@
-459,9
+475,3
@@
usb_attach_device(hci_t *controller, int hubaddress, int port, int speed)
return newdev;
}
return newdev;
}
-void
-usb_fatal (const char *message)
-{
- printf(message);
- for (;;) ;
-}