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/uhci_rh.c | |
parent | 8670b9b81aba6bf51510e337d4f7208d2b4ea320 (diff) |
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/uhci_rh.c')
-rw-r--r-- | payloads/libpayload/drivers/usb/uhci_rh.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/payloads/libpayload/drivers/usb/uhci_rh.c b/payloads/libpayload/drivers/usb/uhci_rh.c index 547f0644b4..44ba498274 100644 --- a/payloads/libpayload/drivers/usb/uhci_rh.c +++ b/payloads/libpayload/drivers/usb/uhci_rh.c @@ -49,7 +49,7 @@ uhci_rh_enable_port (usbdev_t *dev, int port) else if (port == 2) port = PORTSC2; else { - debug("Invalid port %d\n", port); + usb_debug("Invalid port %d\n", port); return; } @@ -73,7 +73,7 @@ uhci_rh_enable_port (usbdev_t *dev, int port) udelay(500); timeout--; } while (((value & (1 << 2)) == 0) && (value & 0x01) && timeout); if (!timeout) - debug("Warning: uhci_rh: port enabling timed out.\n"); + usb_debug("Warning: uhci_rh: port enabling timed out.\n"); } /* disable root hub */ @@ -86,7 +86,7 @@ uhci_rh_disable_port (usbdev_t *dev, int port) else if (port == 2) port = PORTSC2; else { - debug("Invalid port %d\n", port); + usb_debug("Invalid port %d\n", port); return; } uhci_reg_write16(controller, port, @@ -100,7 +100,7 @@ uhci_rh_disable_port (usbdev_t *dev, int port) udelay(500); timeout--; } while (((value & (1 << 2)) != 0) && timeout); if (!timeout) - debug("Warning: uhci_rh: port disabling timed out.\n"); + usb_debug("Warning: uhci_rh: port disabling timed out.\n"); } static void @@ -114,7 +114,7 @@ uhci_rh_scanport (usbdev_t *dev, int port) portsc = PORTSC2; offset = 1; } else { - debug("Invalid port %d\n", port); + usb_debug("Invalid port %d\n", port); return; } int devno = RH_INST (dev)->port[offset]; @@ -147,25 +147,25 @@ uhci_rh_report_port_changes (usbdev_t *dev) stored = (RH_INST (dev)->port[0] == -1); real = ((uhci_reg_read16 (dev->controller, PORTSC1) & 1) == 0); if (stored != real) { - debug("change on port 1\n"); + usb_debug("change on port 1\n"); return 1; } stored = (RH_INST (dev)->port[1] == -1); real = ((uhci_reg_read16 (dev->controller, PORTSC2) & 1) == 0); if (stored != real) { - debug("change on port 2\n"); + usb_debug("change on port 2\n"); return 2; } // maybe detach+attach happened between two scans? if ((uhci_reg_read16 (dev->controller, PORTSC1) & 2) > 0) { - debug("possibly re-attached on port 1\n"); + usb_debug("possibly re-attached on port 1\n"); return 1; } if ((uhci_reg_read16 (dev->controller, PORTSC2) & 2) > 0) { - debug("possibly re-attached on port 2\n"); + usb_debug("possibly re-attached on port 2\n"); return 2; } |