libpayload: Turn the "debug" #define into the usb_debug static inline function.
The "debug" macro used internally in the libpayload USB subsystem was very generically named and would leak into consumers of the library that included usb.h directly or indirectly. This change turns that #define from a macro into a static inline function to move away from the preprocessor, and also renames it to usb_debug so it's less likely to collide with something unrelated. Change-Id: I18717df111aa9671495f8a2a5bdb2c6311fa7acf Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://review.coreboot.org/1738 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
This commit is contained in:
committed by
Stefan Reinauer
parent
8670b9b81a
commit
93ded5905c
@ -381,7 +381,7 @@ read_capacity (usbdev_t *dev)
|
||||
cb.command = 0x25; // read capacity
|
||||
u8 buf[8];
|
||||
|
||||
debug ("Reading capacity of mass storage device.\n");
|
||||
usb_debug ("Reading capacity of mass storage device.\n");
|
||||
int count = 0, ret;
|
||||
while (count++ < 20) {
|
||||
switch (ret = execute_command
|
||||
@ -430,9 +430,9 @@ usb_msc_init (usbdev_t *dev)
|
||||
interface_descriptor_t *interface =
|
||||
(interface_descriptor_t *) (((char *) cd) + cd->bLength);
|
||||
|
||||
debug (" it uses %s command set\n",
|
||||
usb_debug (" it uses %s command set\n",
|
||||
msc_subclass_strings[interface->bInterfaceSubClass]);
|
||||
debug (" it uses %s protocol\n",
|
||||
usb_debug (" it uses %s protocol\n",
|
||||
msc_protocol_strings[interface->bInterfaceProtocol]);
|
||||
|
||||
|
||||
@ -479,11 +479,11 @@ usb_msc_init (usbdev_t *dev)
|
||||
printf("couldn't find bulk-out endpoint");
|
||||
return;
|
||||
}
|
||||
debug (" using endpoint %x as in, %x as out\n",
|
||||
usb_debug (" using endpoint %x as in, %x as out\n",
|
||||
MSC_INST (dev)->bulk_in->endpoint,
|
||||
MSC_INST (dev)->bulk_out->endpoint);
|
||||
|
||||
debug (" has %d luns\n", get_max_luns (dev) + 1);
|
||||
usb_debug (" has %d luns\n", get_max_luns (dev) + 1);
|
||||
|
||||
printf (" Waiting for device to become ready...");
|
||||
timeout = 30 * 10; /* SCSI/ATA specs say we have to wait up to 30s. Ugh */
|
||||
@ -507,12 +507,12 @@ usb_msc_init (usbdev_t *dev)
|
||||
printf ("ok.\n");
|
||||
}
|
||||
|
||||
debug (" spin up");
|
||||
usb_debug (" spin up");
|
||||
for (i = 0; i < 30; i++) {
|
||||
debug (".");
|
||||
usb_debug (".");
|
||||
switch (spin_up (dev)) {
|
||||
case MSC_COMMAND_OK:
|
||||
debug (" OK.");
|
||||
usb_debug (" OK.");
|
||||
break;
|
||||
case MSC_COMMAND_FAIL:
|
||||
mdelay (100);
|
||||
@ -522,7 +522,7 @@ usb_msc_init (usbdev_t *dev)
|
||||
}
|
||||
break;
|
||||
}
|
||||
debug ("\n");
|
||||
usb_debug ("\n");
|
||||
|
||||
if ((read_capacity (dev) == MSC_COMMAND_OK) && usbdisk_create) {
|
||||
usbdisk_create (dev);
|
||||
|
Reference in New Issue
Block a user