diff options
author | Wolfgang Denk <wd@denx.de> | 2009-02-15 22:55:56 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-02-15 22:55:56 +0100 |
commit | 952a6bdd77b6b0a780e76a0b17ad139f4ee6dfde (patch) | |
tree | 1582bc6f35cac2436307ee466a71f81ac6193a5a /drivers | |
parent | f8eab9c3e15db68d20cad8e257da228b518cde85 (diff) | |
parent | 9704f9caf53f5cae547d8c5e1ae94aa4e57b160f (diff) | |
download | u-boot-imx-952a6bdd77b6b0a780e76a0b17ad139f4ee6dfde.zip u-boot-imx-952a6bdd77b6b0a780e76a0b17ad139f4ee6dfde.tar.gz u-boot-imx-952a6bdd77b6b0a780e76a0b17ad139f4ee6dfde.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/usbtty.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index 7eba470..2624e6f 100644 --- a/drivers/serial/usbtty.c +++ b/drivers/serial/usbtty.c @@ -150,8 +150,7 @@ struct acm_config_desc { /* Slave Interface */ struct usb_interface_descriptor data_class_interface; - struct usb_endpoint_descriptor - data_endpoints[NUM_ENDPOINTS-1] __attribute__((packed)); + struct usb_endpoint_descriptor data_endpoints[NUM_ENDPOINTS-1]; } __attribute__((packed)); static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = { @@ -280,10 +279,8 @@ static struct rs232_emu rs232_desc={ struct gserial_config_desc { struct usb_configuration_descriptor configuration_desc; - struct usb_interface_descriptor - interface_desc[NUM_GSERIAL_INTERFACES] __attribute__((packed)); - struct usb_endpoint_descriptor - data_endpoints[NUM_ENDPOINTS] __attribute__((packed)); + struct usb_interface_descriptor interface_desc[NUM_GSERIAL_INTERFACES]; + struct usb_endpoint_descriptor data_endpoints[NUM_ENDPOINTS]; } __attribute__((packed)); @@ -433,6 +430,9 @@ int usbtty_getc (void) */ void usbtty_putc (const char c) { + if (!usbtty_configured ()) + return; + buf_push (&usbtty_output, &c, 1); /* If \n, also do \r */ if (c == '\n') @@ -486,8 +486,12 @@ static void __usbtty_puts (const char *str, int len) void usbtty_puts (const char *str) { int n; - int len = strlen (str); + int len; + + if (!usbtty_configured ()) + return; + len = strlen (str); /* add '\r' for each '\n' */ while (len > 0) { n = next_nl_pos (str); |