diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-23 13:55:52 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-23 13:55:52 -0700 |
| commit | b26c3a996515d6ea9be8d840f8973c5892c9961c (patch) | |
| tree | 401f54b4c5cbc7ff2a36fcbb01e5e87856109a5e /usb | |
| parent | f8c15b8f051b95e1ac809f45c4a51cfbbd58ca54 (diff) | |
| download | patches-b26c3a996515d6ea9be8d840f8973c5892c9961c.tar.gz | |
move a file to usb/ from usb.current/
Diffstat (limited to 'usb')
| -rw-r--r-- | usb/usb-mos7840-fix-debug-log-messages.patch | 1112 |
1 files changed, 1112 insertions, 0 deletions
diff --git a/usb/usb-mos7840-fix-debug-log-messages.patch b/usb/usb-mos7840-fix-debug-log-messages.patch new file mode 100644 index 00000000000000..3f8e71d1707ab4 --- /dev/null +++ b/usb/usb-mos7840-fix-debug-log-messages.patch @@ -0,0 +1,1112 @@ +From tony-cook@bigpond.com Tue Apr 21 17:03:37 2009 +From: Tony Cook <tony-cook@bigpond.com> +Date: Sat, 18 Apr 2009 22:55:06 +0930 +Subject: USB: mos7840: fix debug log messages +Cc: Greg KH <gregkh@suse.de> +Message-ID: <49E9D4B2.2010807@bigpond.com> + + +This patch removes all the unnecessary "\n"s that the debug print +statements have, which result in everything appearing double spaced +and unreadable in the logs. + +Signed-off-by: Tony Cook <tony-cook@bigpond.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/mos7840.c | 318 +++++++++++++++++++++---------------------- + 1 file changed, 162 insertions(+), 156 deletions(-) + +--- a/drivers/usb/serial/mos7840.c ++++ b/drivers/usb/serial/mos7840.c +@@ -238,7 +238,7 @@ static int mos7840_set_reg_sync(struct u + { + struct usb_device *dev = port->serial->dev; + val = val & 0x00ff; +- dbg("mos7840_set_reg_sync offset is %x, value %x\n", reg, val); ++ dbg("mos7840_set_reg_sync offset is %x, value %x", reg, val); + + return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), MCS_WRREQ, + MCS_WR_RTYPE, val, reg, NULL, 0, +@@ -260,7 +260,7 @@ static int mos7840_get_reg_sync(struct u + ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), MCS_RDREQ, + MCS_RD_RTYPE, 0, reg, val, VENDOR_READ_LENGTH, + MOS_WDR_TIMEOUT); +- dbg("mos7840_get_reg_sync offset is %x, return val %x\n", reg, *val); ++ dbg("mos7840_get_reg_sync offset is %x, return val %x", reg, *val); + *val = (*val) & 0x00ff; + return ret; + } +@@ -282,18 +282,18 @@ static int mos7840_set_uart_reg(struct u + if (port->serial->num_ports == 4) { + val |= (((__u16) port->number - + (__u16) (port->serial->minor)) + 1) << 8; +- dbg("mos7840_set_uart_reg application number is %x\n", val); ++ dbg("mos7840_set_uart_reg application number is %x", val); + } else { + if (((__u16) port->number - (__u16) (port->serial->minor)) == 0) { + val |= (((__u16) port->number - + (__u16) (port->serial->minor)) + 1) << 8; +- dbg("mos7840_set_uart_reg application number is %x\n", ++ dbg("mos7840_set_uart_reg application number is %x", + val); + } else { + val |= + (((__u16) port->number - + (__u16) (port->serial->minor)) + 2) << 8; +- dbg("mos7840_set_uart_reg application number is %x\n", ++ dbg("mos7840_set_uart_reg application number is %x", + val); + } + } +@@ -315,24 +315,24 @@ static int mos7840_get_uart_reg(struct u + int ret = 0; + __u16 Wval; + +- /* dbg("application number is %4x \n", ++ /* dbg("application number is %4x", + (((__u16)port->number - (__u16)(port->serial->minor))+1)<<8); */ + /* Wval is same as application number */ + if (port->serial->num_ports == 4) { + Wval = + (((__u16) port->number - (__u16) (port->serial->minor)) + + 1) << 8; +- dbg("mos7840_get_uart_reg application number is %x\n", Wval); ++ dbg("mos7840_get_uart_reg application number is %x", Wval); + } else { + if (((__u16) port->number - (__u16) (port->serial->minor)) == 0) { + Wval = (((__u16) port->number - + (__u16) (port->serial->minor)) + 1) << 8; +- dbg("mos7840_get_uart_reg application number is %x\n", ++ dbg("mos7840_get_uart_reg application number is %x", + Wval); + } else { + Wval = (((__u16) port->number - + (__u16) (port->serial->minor)) + 2) << 8; +- dbg("mos7840_get_uart_reg application number is %x\n", ++ dbg("mos7840_get_uart_reg application number is %x", + Wval); + } + } +@@ -346,11 +346,11 @@ static int mos7840_get_uart_reg(struct u + static void mos7840_dump_serial_port(struct moschip_port *mos7840_port) + { + +- dbg("***************************************\n"); +- dbg("SpRegOffset is %2x\n", mos7840_port->SpRegOffset); +- dbg("ControlRegOffset is %2x \n", mos7840_port->ControlRegOffset); +- dbg("DCRRegOffset is %2x \n", mos7840_port->DcrRegOffset); +- dbg("***************************************\n"); ++ dbg("***************************************"); ++ dbg("SpRegOffset is %2x", mos7840_port->SpRegOffset); ++ dbg("ControlRegOffset is %2x", mos7840_port->ControlRegOffset); ++ dbg("DCRRegOffset is %2x", mos7840_port->DcrRegOffset); ++ dbg("***************************************"); + + } + +@@ -474,12 +474,12 @@ static void mos7840_control_callback(str + goto exit; + } + +- dbg("%s urb buffer size is %d\n", __func__, urb->actual_length); +- dbg("%s mos7840_port->MsrLsr is %d port %d\n", __func__, ++ dbg("%s urb buffer size is %d", __func__, urb->actual_length); ++ dbg("%s mos7840_port->MsrLsr is %d port %d", __func__, + mos7840_port->MsrLsr, mos7840_port->port_num); + data = urb->transfer_buffer; + regval = (__u8) data[0]; +- dbg("%s data is %x\n", __func__, regval); ++ dbg("%s data is %x", __func__, regval); + if (mos7840_port->MsrLsr == 0) + mos7840_handle_new_msr(mos7840_port, regval); + else if (mos7840_port->MsrLsr == 1) +@@ -538,7 +538,7 @@ static void mos7840_interrupt_callback(s + __u16 wval, wreg = 0; + int status = urb->status; + +- dbg("%s", " : Entering\n"); ++ dbg("%s", " : Entering"); + + switch (status) { + case 0: +@@ -570,7 +570,7 @@ static void mos7840_interrupt_callback(s + * Byte 5 FIFO status for both */ + + if (length && length > 5) { +- dbg("%s \n", "Wrong data !!!"); ++ dbg("%s", "Wrong data !!!"); + return; + } + +@@ -587,17 +587,17 @@ static void mos7840_interrupt_callback(s + (__u16) (serial->minor)) + 1) << 8; + if (mos7840_port->open) { + if (sp[i] & 0x01) { +- dbg("SP%d No Interrupt !!!\n", i); ++ dbg("SP%d No Interrupt !!!", i); + } else { + switch (sp[i] & 0x0f) { + case SERIAL_IIR_RLS: + dbg("Serial Port %d: Receiver status error or ", i); +- dbg("address bit detected in 9-bit mode\n"); ++ dbg("address bit detected in 9-bit mode"); + mos7840_port->MsrLsr = 1; + wreg = LINE_STATUS_REGISTER; + break; + case SERIAL_IIR_MS: +- dbg("Serial Port %d: Modem status change\n", i); ++ dbg("Serial Port %d: Modem status change", i); + mos7840_port->MsrLsr = 0; + wreg = MODEM_STATUS_REGISTER; + break; +@@ -689,7 +689,7 @@ static void mos7840_bulk_in_callback(str + + mos7840_port = urb->context; + if (!mos7840_port) { +- dbg("%s", "NULL mos7840_port pointer \n"); ++ dbg("%s", "NULL mos7840_port pointer"); + mos7840_port->read_urb_busy = false; + return; + } +@@ -702,41 +702,41 @@ static void mos7840_bulk_in_callback(str + + port = (struct usb_serial_port *)mos7840_port->port; + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Port Paranoia failed \n"); ++ dbg("%s", "Port Paranoia failed"); + mos7840_port->read_urb_busy = false; + return; + } + + serial = mos7840_get_usb_serial(port, __func__); + if (!serial) { +- dbg("%s\n", "Bad serial pointer "); ++ dbg("%s", "Bad serial pointer"); + mos7840_port->read_urb_busy = false; + return; + } + +- dbg("%s\n", "Entering... \n"); ++ dbg("%s", "Entering... "); + + data = urb->transfer_buffer; + +- dbg("%s", "Entering ........... \n"); ++ dbg("%s", "Entering ..........."); + + if (urb->actual_length) { + tty = tty_port_tty_get(&mos7840_port->port->port); + if (tty) { + tty_buffer_request_room(tty, urb->actual_length); + tty_insert_flip_string(tty, data, urb->actual_length); +- dbg(" %s \n", data); ++ dbg(" %s ", data); + tty_flip_buffer_push(tty); + tty_kref_put(tty); + } + mos7840_port->icount.rx += urb->actual_length; + smp_wmb(); +- dbg("mos7840_port->icount.rx is %d:\n", ++ dbg("mos7840_port->icount.rx is %d:", + mos7840_port->icount.rx); + } + + if (!mos7840_port->read_urb) { +- dbg("%s", "URB KILLED !!!\n"); ++ dbg("%s", "URB KILLED !!!"); + mos7840_port->read_urb_busy = false; + return; + } +@@ -777,16 +777,16 @@ static void mos7840_bulk_out_data_callba + spin_unlock(&mos7840_port->pool_lock); + + if (status) { +- dbg("nonzero write bulk status received:%d\n", status); ++ dbg("nonzero write bulk status received:%d", status); + return; + } + + if (mos7840_port_paranoia_check(mos7840_port->port, __func__)) { +- dbg("%s", "Port Paranoia failed \n"); ++ dbg("%s", "Port Paranoia failed"); + return; + } + +- dbg("%s \n", "Entering ........."); ++ dbg("%s", "Entering ........."); + + tty = tty_port_tty_get(&mos7840_port->port->port); + if (tty && mos7840_port->open) +@@ -830,15 +830,17 @@ static int mos7840_open(struct tty_struc + struct moschip_port *mos7840_port; + struct moschip_port *port0; + ++ dbg ("%s enter", __func__); ++ + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Port Paranoia failed \n"); ++ dbg("%s", "Port Paranoia failed"); + return -ENODEV; + } + + serial = port->serial; + + if (mos7840_serial_paranoia_check(serial, __func__)) { +- dbg("%s", "Serial Paranoia failed \n"); ++ dbg("%s", "Serial Paranoia failed"); + return -ENODEV; + } + +@@ -891,20 +893,20 @@ static int mos7840_open(struct tty_struc + Data = 0x0; + status = mos7840_get_reg_sync(port, mos7840_port->SpRegOffset, &Data); + if (status < 0) { +- dbg("Reading Spreg failed\n"); ++ dbg("Reading Spreg failed"); + return -1; + } + Data |= 0x80; + status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data); + if (status < 0) { +- dbg("writing Spreg failed\n"); ++ dbg("writing Spreg failed"); + return -1; + } + + Data &= ~0x80; + status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, Data); + if (status < 0) { +- dbg("writing Spreg failed\n"); ++ dbg("writing Spreg failed"); + return -1; + } + /* End of block to be checked */ +@@ -913,7 +915,7 @@ static int mos7840_open(struct tty_struc + status = mos7840_get_reg_sync(port, mos7840_port->ControlRegOffset, + &Data); + if (status < 0) { +- dbg("Reading Controlreg failed\n"); ++ dbg("Reading Controlreg failed"); + return -1; + } + Data |= 0x08; /* Driver done bit */ +@@ -921,7 +923,7 @@ static int mos7840_open(struct tty_struc + status = mos7840_set_reg_sync(port, + mos7840_port->ControlRegOffset, Data); + if (status < 0) { +- dbg("writing Controlreg failed\n"); ++ dbg("writing Controlreg failed"); + return -1; + } + /* do register settings here */ +@@ -932,21 +934,21 @@ static int mos7840_open(struct tty_struc + Data = 0x00; + status = mos7840_set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); + if (status < 0) { +- dbg("disableing interrupts failed\n"); ++ dbg("disabling interrupts failed"); + return -1; + } + /* Set FIFO_CONTROL_REGISTER to the default value */ + Data = 0x00; + status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); + if (status < 0) { +- dbg("Writing FIFO_CONTROL_REGISTER failed\n"); ++ dbg("Writing FIFO_CONTROL_REGISTER failed"); + return -1; + } + + Data = 0xcf; + status = mos7840_set_uart_reg(port, FIFO_CONTROL_REGISTER, Data); + if (status < 0) { +- dbg("Writing FIFO_CONTROL_REGISTER failed\n"); ++ dbg("Writing FIFO_CONTROL_REGISTER failed"); + return -1; + } + +@@ -1043,12 +1045,12 @@ static int mos7840_open(struct tty_struc + * (can't set it up in mos7840_startup as the * + * structures were not set up at that time.) */ + +- dbg("port number is %d \n", port->number); +- dbg("serial number is %d \n", port->serial->minor); +- dbg("Bulkin endpoint is %d \n", port->bulk_in_endpointAddress); +- dbg("BulkOut endpoint is %d \n", port->bulk_out_endpointAddress); +- dbg("Interrupt endpoint is %d \n", port->interrupt_in_endpointAddress); +- dbg("port's number in the device is %d\n", mos7840_port->port_num); ++ dbg("port number is %d", port->number); ++ dbg("serial number is %d", port->serial->minor); ++ dbg("Bulkin endpoint is %d", port->bulk_in_endpointAddress); ++ dbg("BulkOut endpoint is %d", port->bulk_out_endpointAddress); ++ dbg("Interrupt endpoint is %d", port->interrupt_in_endpointAddress); ++ dbg("port's number in the device is %d", mos7840_port->port_num); + mos7840_port->read_urb = port->read_urb; + + /* set up our bulk in urb */ +@@ -1061,7 +1063,7 @@ static int mos7840_open(struct tty_struc + mos7840_port->read_urb->transfer_buffer_length, + mos7840_bulk_in_callback, mos7840_port); + +- dbg("mos7840_open: bulkin endpoint is %d\n", ++ dbg("mos7840_open: bulkin endpoint is %d", + port->bulk_in_endpointAddress); + mos7840_port->read_urb_busy = true; + response = usb_submit_urb(mos7840_port->read_urb, GFP_KERNEL); +@@ -1087,9 +1089,11 @@ static int mos7840_open(struct tty_struc + mos7840_port->icount.tx = 0; + mos7840_port->icount.rx = 0; + +- dbg("\n\nusb_serial serial:%p mos7840_port:%p\n usb_serial_port port:%p\n\n", ++ dbg("usb_serial serial:%p mos7840_port:%p\n usb_serial_port port:%p", + serial, mos7840_port, port); + ++ dbg ("%s leave", __func__); ++ + return 0; + + } +@@ -1112,16 +1116,16 @@ static int mos7840_chars_in_buffer(struc + unsigned long flags; + struct moschip_port *mos7840_port; + +- dbg("%s \n", " mos7840_chars_in_buffer:entering ..........."); ++ dbg("%s", " mos7840_chars_in_buffer:entering ..........."); + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return 0; + } + + mos7840_port = mos7840_get_port_private(port); + if (mos7840_port == NULL) { +- dbg("%s \n", "mos7840_break:leaving ..........."); ++ dbg("%s", "mos7840_break:leaving ..........."); + return 0; + } + +@@ -1190,16 +1194,16 @@ static void mos7840_close(struct tty_str + int j; + __u16 Data; + +- dbg("%s\n", "mos7840_close:entering..."); ++ dbg("%s", "mos7840_close:entering..."); + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Port Paranoia failed \n"); ++ dbg("%s", "Port Paranoia failed"); + return; + } + + serial = mos7840_get_usb_serial(port, __func__); + if (!serial) { +- dbg("%s", "Serial Paranoia failed \n"); ++ dbg("%s", "Serial Paranoia failed"); + return; + } + +@@ -1231,27 +1235,27 @@ static void mos7840_close(struct tty_str + * and interrupt read if they exists */ + if (serial->dev) { + if (mos7840_port->write_urb) { +- dbg("%s", "Shutdown bulk write\n"); ++ dbg("%s", "Shutdown bulk write"); + usb_kill_urb(mos7840_port->write_urb); + } + if (mos7840_port->read_urb) { +- dbg("%s", "Shutdown bulk read\n"); ++ dbg("%s", "Shutdown bulk read"); + usb_kill_urb(mos7840_port->read_urb); + mos7840_port->read_urb_busy = false; + } + if ((&mos7840_port->control_urb)) { +- dbg("%s", "Shutdown control read\n"); ++ dbg("%s", "Shutdown control read"); + /*/ usb_kill_urb (mos7840_port->control_urb); */ + } + } + /* if(mos7840_port->ctrl_buf != NULL) */ + /* kfree(mos7840_port->ctrl_buf); */ + port0->open_ports--; +- dbg("mos7840_num_open_ports in close%d:in port%d\n", ++ dbg("mos7840_num_open_ports in close%d:in port%d", + port0->open_ports, port->number); + if (port0->open_ports == 0) { + if (serial->port[0]->interrupt_in_urb) { +- dbg("%s", "Shutdown interrupt_in_urb\n"); ++ dbg("%s", "Shutdown interrupt_in_urb"); + usb_kill_urb(serial->port[0]->interrupt_in_urb); + } + } +@@ -1271,7 +1275,7 @@ static void mos7840_close(struct tty_str + + mos7840_port->open = 0; + +- dbg("%s \n", "Leaving ............"); ++ dbg("%s", "Leaving ............"); + } + + /************************************************************************ +@@ -1326,17 +1330,17 @@ static void mos7840_break(struct tty_str + struct usb_serial *serial; + struct moschip_port *mos7840_port; + +- dbg("%s \n", "Entering ..........."); +- dbg("mos7840_break: Start\n"); ++ dbg("%s", "Entering ..........."); ++ dbg("mos7840_break: Start"); + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Port Paranoia failed \n"); ++ dbg("%s", "Port Paranoia failed"); + return; + } + + serial = mos7840_get_usb_serial(port, __func__); + if (!serial) { +- dbg("%s", "Serial Paranoia failed \n"); ++ dbg("%s", "Serial Paranoia failed"); + return; + } + +@@ -1356,7 +1360,7 @@ static void mos7840_break(struct tty_str + + /* FIXME: no locking on shadowLCR anywhere in driver */ + mos7840_port->shadowLCR = data; +- dbg("mcs7840_break mos7840_port->shadowLCR is %x\n", ++ dbg("mcs7840_break mos7840_port->shadowLCR is %x", + mos7840_port->shadowLCR); + mos7840_set_uart_reg(port, LINE_CONTROL_REGISTER, + mos7840_port->shadowLCR); +@@ -1380,17 +1384,17 @@ static int mos7840_write_room(struct tty + unsigned long flags; + struct moschip_port *mos7840_port; + +- dbg("%s \n", " mos7840_write_room:entering ..........."); ++ dbg("%s", " mos7840_write_room:entering ..........."); + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); +- dbg("%s \n", " mos7840_write_room:leaving ..........."); ++ dbg("%s", "Invalid port"); ++ dbg("%s", " mos7840_write_room:leaving ..........."); + return -1; + } + + mos7840_port = mos7840_get_port_private(port); + if (mos7840_port == NULL) { +- dbg("%s \n", "mos7840_break:leaving ..........."); ++ dbg("%s", "mos7840_break:leaving ..........."); + return -1; + } + +@@ -1430,16 +1434,16 @@ static int mos7840_write(struct tty_stru + /* __u16 Data; */ + const unsigned char *current_position = data; + unsigned char *data1; +- dbg("%s \n", "entering ..........."); +- /* dbg("mos7840_write: mos7840_port->shadowLCR is %x\n", ++ dbg("%s", "entering ..........."); ++ /* dbg("mos7840_write: mos7840_port->shadowLCR is %x", + mos7840_port->shadowLCR); */ + + #ifdef NOTMOS7840 + Data = 0x00; + status = mos7840_get_uart_reg(port, LINE_CONTROL_REGISTER, &Data); + mos7840_port->shadowLCR = Data; +- dbg("mos7840_write: LINE_CONTROL_REGISTER is %x\n", Data); +- dbg("mos7840_write: mos7840_port->shadowLCR is %x\n", ++ dbg("mos7840_write: LINE_CONTROL_REGISTER is %x", Data); ++ dbg("mos7840_write: mos7840_port->shadowLCR is %x", + mos7840_port->shadowLCR); + + /* Data = 0x03; */ +@@ -1453,32 +1457,32 @@ static int mos7840_write(struct tty_stru + /* status = mos7840_set_uart_reg(port,DIVISOR_LATCH_LSB,Data); */ + Data = 0x00; + status = mos7840_get_uart_reg(port, DIVISOR_LATCH_LSB, &Data); +- dbg("mos7840_write:DLL value is %x\n", Data); ++ dbg("mos7840_write:DLL value is %x", Data); + + Data = 0x0; + status = mos7840_get_uart_reg(port, DIVISOR_LATCH_MSB, &Data); +- dbg("mos7840_write:DLM value is %x\n", Data); ++ dbg("mos7840_write:DLM value is %x", Data); + + Data = Data & ~SERIAL_LCR_DLAB; +- dbg("mos7840_write: mos7840_port->shadowLCR is %x\n", ++ dbg("mos7840_write: mos7840_port->shadowLCR is %x", + mos7840_port->shadowLCR); + status = mos7840_set_uart_reg(port, LINE_CONTROL_REGISTER, Data); + #endif + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Port Paranoia failed \n"); ++ dbg("%s", "Port Paranoia failed"); + return -1; + } + + serial = port->serial; + if (mos7840_serial_paranoia_check(serial, __func__)) { +- dbg("%s", "Serial Paranoia failed \n"); ++ dbg("%s", "Serial Paranoia failed"); + return -1; + } + + mos7840_port = mos7840_get_port_private(port); + if (mos7840_port == NULL) { +- dbg("%s", "mos7840_port is NULL\n"); ++ dbg("%s", "mos7840_port is NULL"); + return -1; + } + +@@ -1490,7 +1494,7 @@ static int mos7840_write(struct tty_stru + if (!mos7840_port->busy[i]) { + mos7840_port->busy[i] = 1; + urb = mos7840_port->write_urb_pool[i]; +- dbg("\nURB:%d", i); ++ dbg("URB:%d", i); + break; + } + } +@@ -1525,7 +1529,7 @@ static int mos7840_write(struct tty_stru + mos7840_bulk_out_data_callback, mos7840_port); + + data1 = urb->transfer_buffer; +- dbg("\nbulkout endpoint is %d", port->bulk_out_endpointAddress); ++ dbg("bulkout endpoint is %d", port->bulk_out_endpointAddress); + + /* send it down the pipe */ + status = usb_submit_urb(urb, GFP_ATOMIC); +@@ -1540,7 +1544,7 @@ static int mos7840_write(struct tty_stru + bytes_sent = transfer_size; + mos7840_port->icount.tx += transfer_size; + smp_wmb(); +- dbg("mos7840_port->icount.tx is %d:\n", mos7840_port->icount.tx); ++ dbg("mos7840_port->icount.tx is %d:", mos7840_port->icount.tx); + exit: + return bytes_sent; + +@@ -1559,11 +1563,11 @@ static void mos7840_throttle(struct tty_ + int status; + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return; + } + +- dbg("- port %d\n", port->number); ++ dbg("- port %d", port->number); + + mos7840_port = mos7840_get_port_private(port); + +@@ -1571,11 +1575,11 @@ static void mos7840_throttle(struct tty_ + return; + + if (!mos7840_port->open) { +- dbg("%s\n", "port not opened"); ++ dbg("%s", "port not opened"); + return; + } + +- dbg("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .........."); + + /* if we are implementing XON/XOFF, send the stop character */ + if (I_IXOFF(tty)) { +@@ -1609,7 +1613,7 @@ static void mos7840_unthrottle(struct tt + struct moschip_port *mos7840_port = mos7840_get_port_private(port); + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return; + } + +@@ -1621,7 +1625,7 @@ static void mos7840_unthrottle(struct tt + return; + } + +- dbg("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .........."); + + /* if we are implementing XON/XOFF, send the start character */ + if (I_IXOFF(tty)) { +@@ -1706,7 +1710,7 @@ static int mos7840_tiocmset(struct tty_s + + status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr); + if (status < 0) { +- dbg("setting MODEM_CONTROL_REGISTER Failed\n"); ++ dbg("setting MODEM_CONTROL_REGISTER Failed"); + return status; + } + +@@ -1775,11 +1779,11 @@ static int mos7840_calc_baud_rate_diviso + custom++; + *divisor = custom; + +- dbg(" Baud %d = %d\n", baudrate, custom); ++ dbg(" Baud %d = %d", baudrate, custom); + return 0; + } + +- dbg("%s\n", " Baud calculation Failed..."); ++ dbg("%s", " Baud calculation Failed..."); + return -1; + #endif + } +@@ -1805,16 +1809,16 @@ static int mos7840_send_cmd_write_baud_r + + port = (struct usb_serial_port *)mos7840_port->port; + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return -1; + } + + if (mos7840_serial_paranoia_check(port->serial, __func__)) { +- dbg("%s", "Invalid Serial \n"); ++ dbg("%s", "Invalid Serial"); + return -1; + } + +- dbg("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .........."); + + number = mos7840_port->port->number - mos7840_port->port->serial->minor; + +@@ -1830,7 +1834,7 @@ static int mos7840_send_cmd_write_baud_r + status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, + Data); + if (status < 0) { +- dbg("Writing spreg failed in set_serial_baud\n"); ++ dbg("Writing spreg failed in set_serial_baud"); + return -1; + } + #endif +@@ -1843,7 +1847,7 @@ static int mos7840_send_cmd_write_baud_r + status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, + Data); + if (status < 0) { +- dbg("Writing spreg failed in set_serial_baud\n"); ++ dbg("Writing spreg failed in set_serial_baud"); + return -1; + } + #endif +@@ -1858,14 +1862,14 @@ static int mos7840_send_cmd_write_baud_r + status = mos7840_get_reg_sync(port, mos7840_port->SpRegOffset, + &Data); + if (status < 0) { +- dbg("reading spreg failed in set_serial_baud\n"); ++ dbg("reading spreg failed in set_serial_baud"); + return -1; + } + Data = (Data & 0x8f) | clk_sel_val; + status = mos7840_set_reg_sync(port, mos7840_port->SpRegOffset, + Data); + if (status < 0) { +- dbg("Writing spreg failed in set_serial_baud\n"); ++ dbg("Writing spreg failed in set_serial_baud"); + return -1; + } + /* Calculate the Divisor */ +@@ -1881,11 +1885,11 @@ static int mos7840_send_cmd_write_baud_r + + /* Write the divisor */ + Data = (unsigned char)(divisor & 0xff); +- dbg("set_serial_baud Value to write DLL is %x\n", Data); ++ dbg("set_serial_baud Value to write DLL is %x", Data); + mos7840_set_uart_reg(port, DIVISOR_LATCH_LSB, Data); + + Data = (unsigned char)((divisor & 0xff00) >> 8); +- dbg("set_serial_baud Value to write DLM is %x\n", Data); ++ dbg("set_serial_baud Value to write DLM is %x", Data); + mos7840_set_uart_reg(port, DIVISOR_LATCH_MSB, Data); + + /* Disable access to divisor latch */ +@@ -1923,12 +1927,12 @@ static void mos7840_change_port_settings + port = (struct usb_serial_port *)mos7840_port->port; + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return; + } + + if (mos7840_serial_paranoia_check(port->serial, __func__)) { +- dbg("%s", "Invalid Serial \n"); ++ dbg("%s", "Invalid Serial"); + return; + } + +@@ -1941,7 +1945,7 @@ static void mos7840_change_port_settings + return; + } + +- dbg("%s", "Entering .......... \n"); ++ dbg("%s", "Entering .........."); + + lData = LCR_BITS_8; + lStop = LCR_STOP_1; +@@ -2001,7 +2005,7 @@ static void mos7840_change_port_settings + ~(LCR_BITS_MASK | LCR_STOP_MASK | LCR_PAR_MASK); + mos7840_port->shadowLCR |= (lData | lParity | lStop); + +- dbg("mos7840_change_port_settings mos7840_port->shadowLCR is %x\n", ++ dbg("mos7840_change_port_settings mos7840_port->shadowLCR is %x", + mos7840_port->shadowLCR); + /* Disable Interrupts */ + Data = 0x00; +@@ -2043,7 +2047,7 @@ static void mos7840_change_port_settings + + if (!baud) { + /* pick a default, any default... */ +- dbg("%s\n", "Picked default baud..."); ++ dbg("%s", "Picked default baud..."); + baud = 9600; + } + +@@ -2066,7 +2070,7 @@ static void mos7840_change_port_settings + } + wake_up(&mos7840_port->delta_msr_wait); + mos7840_port->delta_msr_cond = 1; +- dbg("mos7840_change_port_settings mos7840_port->shadowLCR is End %x\n", ++ dbg("mos7840_change_port_settings mos7840_port->shadowLCR is End %x", + mos7840_port->shadowLCR); + + return; +@@ -2086,16 +2090,16 @@ static void mos7840_set_termios(struct t + unsigned int cflag; + struct usb_serial *serial; + struct moschip_port *mos7840_port; +- dbg("mos7840_set_termios: START\n"); ++ dbg("mos7840_set_termios: START"); + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return; + } + + serial = port->serial; + + if (mos7840_serial_paranoia_check(serial, __func__)) { +- dbg("%s", "Invalid Serial \n"); ++ dbg("%s", "Invalid Serial"); + return; + } + +@@ -2109,7 +2113,7 @@ static void mos7840_set_termios(struct t + return; + } + +- dbg("%s\n", "setting termios - "); ++ dbg("%s", "setting termios - "); + + cflag = tty->termios->c_cflag; + +@@ -2124,7 +2128,7 @@ static void mos7840_set_termios(struct t + mos7840_change_port_settings(tty, mos7840_port, old_termios); + + if (!mos7840_port->read_urb) { +- dbg("%s", "URB KILLED !!!!!\n"); ++ dbg("%s", "URB KILLED !!!!!"); + return; + } + +@@ -2190,7 +2194,7 @@ static int mos7840_set_modem_info(struct + + port = (struct usb_serial_port *)mos7840_port->port; + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return -1; + } + +@@ -2235,7 +2239,7 @@ static int mos7840_set_modem_info(struct + status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, Data); + unlock_kernel(); + if (status < 0) { +- dbg("setting MODEM_CONTROL_REGISTER Failed\n"); ++ dbg("setting MODEM_CONTROL_REGISTER Failed"); + return -1; + } + +@@ -2320,7 +2324,7 @@ static int mos7840_ioctl(struct tty_stru + int mosret = 0; + + if (mos7840_port_paranoia_check(port, __func__)) { +- dbg("%s", "Invalid port \n"); ++ dbg("%s", "Invalid port"); + return -1; + } + +@@ -2420,9 +2424,8 @@ static int mos7840_calc_num_ports(struct + { + int mos7840_num_ports = 0; + +- dbg("numberofendpoints: %d \n", +- (int)serial->interface->cur_altsetting->desc.bNumEndpoints); +- dbg("numberofendpoints: %d \n", ++ dbg("numberofendpoints: cur %d, alt %d", ++ (int)serial->interface->cur_altsetting->desc.bNumEndpoints, + (int)serial->interface->altsetting->desc.bNumEndpoints); + if (serial->interface->cur_altsetting->desc.bNumEndpoints == 5) { + mos7840_num_ports = serial->num_ports = 2; +@@ -2431,7 +2434,7 @@ static int mos7840_calc_num_ports(struct + serial->num_bulk_out = 4; + mos7840_num_ports = serial->num_ports = 4; + } +- ++ dbg ("mos7840_num_ports = %d", mos7840_num_ports); + return mos7840_num_ports; + } + +@@ -2446,22 +2449,24 @@ static int mos7840_startup(struct usb_se + int i, status; + + __u16 Data; +- dbg("%s \n", " mos7840_startup :entering.........."); ++ dbg("%s", "mos7840_startup :Entering.........."); + + if (!serial) { +- dbg("%s\n", "Invalid Handler"); ++ dbg("%s", "Invalid Handler"); + return -1; + } + + dev = serial->dev; + +- dbg("%s\n", "Entering..."); ++ dbg("%s", "Entering..."); ++ dbg ("mos7840_startup: serial = %p", serial); + + /* we set up the pointers to the endpoints in the mos7840_open * + * function, as the structures aren't created yet. */ + + /* set up port private structures */ + for (i = 0; i < serial->num_ports; ++i) { ++ dbg ("mos7840_startup: configuring port %d............", i); + mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL); + if (mos7840_port == NULL) { + dev_err(&dev->dev, "%s - Out of memory\n", __func__); +@@ -2519,10 +2524,10 @@ static int mos7840_startup(struct usb_se + status = mos7840_get_reg_sync(serial->port[i], + mos7840_port->ControlRegOffset, &Data); + if (status < 0) { +- dbg("Reading ControlReg failed status-0x%x\n", status); ++ dbg("Reading ControlReg failed status-0x%x", status); + break; + } else +- dbg("ControlReg Reading success val is %x, status%d\n", ++ dbg("ControlReg Reading success val is %x, status%d", + Data, status); + Data |= 0x08; /* setting driver done bit */ + Data |= 0x04; /* sp1_bit to have cts change reflect in +@@ -2532,10 +2537,10 @@ static int mos7840_startup(struct usb_se + status = mos7840_set_reg_sync(serial->port[i], + mos7840_port->ControlRegOffset, Data); + if (status < 0) { +- dbg("Writing ControlReg failed(rx_disable) status-0x%x\n", status); ++ dbg("Writing ControlReg failed(rx_disable) status-0x%x", status); + break; + } else +- dbg("ControlReg Writing success(rx_disable) status%d\n", ++ dbg("ControlReg Writing success(rx_disable) status%d", + status); + + /* Write default values in DCR (i.e 0x01 in DCR0, 0x05 in DCR2 +@@ -2544,48 +2549,48 @@ static int mos7840_startup(struct usb_se + status = mos7840_set_reg_sync(serial->port[i], + (__u16) (mos7840_port->DcrRegOffset + 0), Data); + if (status < 0) { +- dbg("Writing DCR0 failed status-0x%x\n", status); ++ dbg("Writing DCR0 failed status-0x%x", status); + break; + } else +- dbg("DCR0 Writing success status%d\n", status); ++ dbg("DCR0 Writing success status%d", status); + + Data = 0x05; + status = mos7840_set_reg_sync(serial->port[i], + (__u16) (mos7840_port->DcrRegOffset + 1), Data); + if (status < 0) { +- dbg("Writing DCR1 failed status-0x%x\n", status); ++ dbg("Writing DCR1 failed status-0x%x", status); + break; + } else +- dbg("DCR1 Writing success status%d\n", status); ++ dbg("DCR1 Writing success status%d", status); + + Data = 0x24; + status = mos7840_set_reg_sync(serial->port[i], + (__u16) (mos7840_port->DcrRegOffset + 2), Data); + if (status < 0) { +- dbg("Writing DCR2 failed status-0x%x\n", status); ++ dbg("Writing DCR2 failed status-0x%x", status); + break; + } else +- dbg("DCR2 Writing success status%d\n", status); ++ dbg("DCR2 Writing success status%d", status); + + /* write values in clkstart0x0 and clkmulti 0x20 */ + Data = 0x0; + status = mos7840_set_reg_sync(serial->port[i], + CLK_START_VALUE_REGISTER, Data); + if (status < 0) { +- dbg("Writing CLK_START_VALUE_REGISTER failed status-0x%x\n", status); ++ dbg("Writing CLK_START_VALUE_REGISTER failed status-0x%x", status); + break; + } else +- dbg("CLK_START_VALUE_REGISTER Writing success status%d\n", status); ++ dbg("CLK_START_VALUE_REGISTER Writing success status%d", status); + + Data = 0x20; + status = mos7840_set_reg_sync(serial->port[i], + CLK_MULTI_REGISTER, Data); + if (status < 0) { +- dbg("Writing CLK_MULTI_REGISTER failed status-0x%x\n", ++ dbg("Writing CLK_MULTI_REGISTER failed status-0x%x", + status); + goto error; + } else +- dbg("CLK_MULTI_REGISTER Writing success status%d\n", ++ dbg("CLK_MULTI_REGISTER Writing success status%d", + status); + + /* write value 0x0 to scratchpad register */ +@@ -2593,11 +2598,11 @@ static int mos7840_startup(struct usb_se + status = mos7840_set_uart_reg(serial->port[i], + SCRATCH_PAD_REGISTER, Data); + if (status < 0) { +- dbg("Writing SCRATCH_PAD_REGISTER failed status-0x%x\n", ++ dbg("Writing SCRATCH_PAD_REGISTER failed status-0x%x", + status); + break; + } else +- dbg("SCRATCH_PAD_REGISTER Writing success status%d\n", ++ dbg("SCRATCH_PAD_REGISTER Writing success status%d", + status); + + /* Zero Length flag register */ +@@ -2608,30 +2613,30 @@ static int mos7840_startup(struct usb_se + status = mos7840_set_reg_sync(serial->port[i], + (__u16) (ZLP_REG1 + + ((__u16)mos7840_port->port_num)), Data); +- dbg("ZLIP offset%x\n", ++ dbg("ZLIP offset %x", + (__u16) (ZLP_REG1 + + ((__u16) mos7840_port->port_num))); + if (status < 0) { +- dbg("Writing ZLP_REG%d failed status-0x%x\n", ++ dbg("Writing ZLP_REG%d failed status-0x%x", + i + 2, status); + break; + } else +- dbg("ZLP_REG%d Writing success status%d\n", ++ dbg("ZLP_REG%d Writing success status%d", + i + 2, status); + } else { + Data = 0xff; + status = mos7840_set_reg_sync(serial->port[i], + (__u16) (ZLP_REG1 + + ((__u16)mos7840_port->port_num) - 0x1), Data); +- dbg("ZLIP offset%x\n", ++ dbg("ZLIP offset %x", + (__u16) (ZLP_REG1 + + ((__u16) mos7840_port->port_num) - 0x1)); + if (status < 0) { +- dbg("Writing ZLP_REG%d failed status-0x%x\n", ++ dbg("Writing ZLP_REG%d failed status-0x%x", + i + 1, status); + break; + } else +- dbg("ZLP_REG%d Writing success status%d\n", ++ dbg("ZLP_REG%d Writing success status%d", + i + 1, status); + + } +@@ -2645,15 +2650,16 @@ static int mos7840_startup(struct usb_se + goto error; + } + } ++ dbg ("mos7840_startup: all ports configured..........."); + + /* Zero Length flag enable */ + Data = 0x0f; + status = mos7840_set_reg_sync(serial->port[0], ZLP_REG5, Data); + if (status < 0) { +- dbg("Writing ZLP_REG5 failed status-0x%x\n", status); ++ dbg("Writing ZLP_REG5 failed status-0x%x", status); + goto error; + } else +- dbg("ZLP_REG5 Writing success status%d\n", status); ++ dbg("ZLP_REG5 Writing success status%d", status); + + /* setting configuration feature to one */ + usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), +@@ -2682,10 +2688,10 @@ static void mos7840_shutdown(struct usb_ + int i; + unsigned long flags; + struct moschip_port *mos7840_port; +- dbg("%s \n", " shutdown :entering.........."); ++ dbg("%s", " shutdown :entering.........."); + + if (!serial) { +- dbg("%s", "Invalid Handler \n"); ++ dbg("%s", "Invalid Handler"); + return; + } + +@@ -2709,7 +2715,7 @@ static void mos7840_shutdown(struct usb_ + mos7840_set_port_private(serial->port[i], NULL); + } + +- dbg("%s\n", "Thank u :: "); ++ dbg("%s", "Thank u :: "); + + } + +@@ -2760,7 +2766,7 @@ static int __init moschip7840_init(void) + { + int retval; + +- dbg("%s \n", " mos7840_init :entering.........."); ++ dbg("%s", " mos7840_init :entering.........."); + + /* Register with the usb serial */ + retval = usb_serial_register(&moschip7840_4port_device); +@@ -2768,14 +2774,14 @@ static int __init moschip7840_init(void) + if (retval) + goto failed_port_device_register; + +- dbg("%s\n", "Entring..."); ++ dbg("%s", "Entering..."); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); + + /* Register with the usb */ + retval = usb_register(&io_driver); + if (retval == 0) { +- dbg("%s\n", "Leaving..."); ++ dbg("%s", "Leaving..."); + return 0; + } + usb_serial_deregister(&moschip7840_4port_device); +@@ -2790,13 +2796,13 @@ failed_port_device_register: + static void __exit moschip7840_exit(void) + { + +- dbg("%s \n", " mos7840_exit :entering.........."); ++ dbg("%s", " mos7840_exit :entering.........."); + + usb_deregister(&io_driver); + + usb_serial_deregister(&moschip7840_4port_device); + +- dbg("%s\n", "Entring..."); ++ dbg("%s", "Entering..."); + } + + module_init(moschip7840_init); |
