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/ohci_rh.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/ohci_rh.c')
-rw-r--r-- | payloads/libpayload/drivers/usb/ohci_rh.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/payloads/libpayload/drivers/usb/ohci_rh.c b/payloads/libpayload/drivers/usb/ohci_rh.c index ac92f45a46..eb3e10b26c 100644 --- a/payloads/libpayload/drivers/usb/ohci_rh.c +++ b/payloads/libpayload/drivers/usb/ohci_rh.c @@ -65,17 +65,17 @@ ohci_rh_enable_port (usbdev_t *dev, int port) } if (OHCI_INST (dev->controller)->opreg->HcRhPortStatus[port] & PortResetStatus) { - debug("Warning: root-hub port reset timed out.\n"); + usb_debug("Warning: root-hub port reset timed out.\n"); break; } if ((200-timeout) < 20) - debug("Warning: port reset too short: %dms; " + usb_debug("Warning: port reset too short: %dms; " "should be at least 10ms.\n", (200-timeout)/2); /* clear reset status change */ OHCI_INST (dev->controller)->opreg->HcRhPortStatus[port] = PortResetStatusChange; - debug ("rh port reset finished after %dms.\n", (200-timeout)/2); + usb_debug ("rh port reset finished after %dms.\n", (200-timeout)/2); } } @@ -96,7 +96,7 @@ static void ohci_rh_scanport (usbdev_t *dev, int port) { if (port >= RH_INST(dev)->numports) { - debug("Invalid port %d\n", port); + usb_debug("Invalid port %d\n", port); return; } @@ -117,7 +117,7 @@ ohci_rh_scanport (usbdev_t *dev, int port) mdelay(100); // wait for signal to stabilize if (!(OHCI_INST(dev->controller)->opreg->HcRhPortStatus[port] & PortEnableStatus)) { - debug ("port enable failed\n"); + usb_debug ("port enable failed\n"); return; } @@ -132,12 +132,12 @@ ohci_rh_report_port_changes (usbdev_t *dev) if (!(OHCI_INST (dev->controller)->opreg->HcInterruptStatus & RootHubStatusChange)) return -1; OHCI_INST (dev->controller)->opreg->HcInterruptStatus = RootHubStatusChange; - debug("port change\n"); + usb_debug("port change\n"); for (i = 0; i < RH_INST(dev)->numports; i++) { // maybe detach+attach happened between two scans? if (OHCI_INST (dev->controller)->opreg->HcRhPortStatus[i] & ConnectStatusChange) { - debug("attachment change on port %d\n", i); + usb_debug("attachment change on port %d\n", i); return i; } } @@ -177,7 +177,7 @@ ohci_rh_init (usbdev_t *dev) RH_INST (dev)->numports = OHCI_INST (dev->controller)->opreg->HcRhDescriptorA & NumberDownstreamPortsMask; RH_INST (dev)->port = malloc(sizeof(int) * RH_INST (dev)->numports); - debug("%d ports registered\n", RH_INST (dev)->numports); + usb_debug("%d ports registered\n", RH_INST (dev)->numports); for (i = 0; i < RH_INST (dev)->numports; i++) { ohci_rh_enable_port (dev, i); @@ -190,5 +190,5 @@ ohci_rh_init (usbdev_t *dev) dev->hub = -1; dev->port = -1; - debug("rh init done\n"); + usb_debug("rh init done\n"); } |