diff options
author | Gabe Black <gabeblack@google.com> | 2012-11-01 15:44:10 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2012-11-07 18:38:37 +0100 |
commit | 93ded5905c36d34c4e4f132623c854bbd895b8c9 (patch) | |
tree | 242d35c611db91e2351a4e942ff518a66110ca38 /payloads/libpayload/drivers/usb/usbmsc.c | |
parent | 8670b9b81aba6bf51510e337d4f7208d2b4ea320 (diff) | |
download | coreboot-93ded5905c36d34c4e4f132623c854bbd895b8c9.tar.xz |
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)
Diffstat (limited to 'payloads/libpayload/drivers/usb/usbmsc.c')
-rw-r--r-- | payloads/libpayload/drivers/usb/usbmsc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c index ac1284129b..db369f7bd1 100644 --- a/payloads/libpayload/drivers/usb/usbmsc.c +++ b/payloads/libpayload/drivers/usb/usbmsc.c @@ -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); |