aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--series9
-rw-r--r--staging/staging-fix-operator-precedence-errors.patch80
-rw-r--r--usb.current/usb-ehci-sched.c-ehci-sitd-scheduling-bugfix.patch46
-rw-r--r--usb.current/usb-fix-mos7840-problem-with-minor-numbers.patch73
-rw-r--r--usb.current/usb-g_file_storage-fix-use-after-free-bug-when-closing-files.patch92
-rw-r--r--usb.current/usb-mos7840-add-new-device-id.patch51
-rw-r--r--usb.current/usb-mos7840-fix-debug-log-messages.patch1112
-rw-r--r--usb.current/usb-pass-mem_flags-to-dma_alloc_coherent.patch44
-rw-r--r--usb/usb-consolidate-usb_unbind_interface-and-usb_driver_release_interface.patch71
9 files changed, 1577 insertions, 1 deletions
diff --git a/series b/series
index ec643755fbf0e5..5034ce61071fe4 100644
--- a/series
+++ b/series
@@ -20,6 +20,12 @@ usb.current/usb-unusual-device-support-for-gold-mp3-player-energy.patch
usb.current/usb-gadget-mips-ci13xxx-udc-bugfixes.patch
usb.current/usb-musb-remove-my-email-address-from-few-musb-related-drivers.patch
usb.current/usb-musb-fix-build-when-config_pm.patch
+usb.current/usb-mos7840-add-new-device-id.patch
+usb.current/usb-fix-mos7840-problem-with-minor-numbers.patch
+usb.current/usb-mos7840-fix-debug-log-messages.patch
+usb.current/usb-ehci-sched.c-ehci-sitd-scheduling-bugfix.patch
+usb.current/usb-g_file_storage-fix-use-after-free-bug-when-closing-files.patch
+usb.current/usb-pass-mem_flags-to-dma_alloc_coherent.patch
#####################################################################
@@ -57,6 +63,7 @@ usb/musb-support-disconnect-after-hnp-roleswitch.patch
usb/musb-use-dma-mode-1-for-tx-if-transfer-size-equals-maxpacket.patch
usb/musb-add-high-bandwidth-iso-support.patch
usb/usb-serial-ftdi-add-high-speed-device-support.patch
+usb/usb-consolidate-usb_unbind_interface-and-usb_driver_release_interface.patch
@@ -169,6 +176,7 @@ staging/staging-remove-unused-include-linux-version.h-s.patch
staging/staging-agnx-replace-print_mac-with-pm.patch
staging/staging-stlc45xx-replace-print_mac-with-pm.patch
staging/staging-winbond-boolean-negation-and-bitwise-operation-in-wrong-order.patch
+staging/staging-fix-operator-precedence-errors.patch
staging/staging-w35und-remove-unused-code-from-wbsoft_configure_filter.patch
staging/staging-w35und-replace-switch-error-handling-with-gotos-in-wb35_hw_init.patch
@@ -195,4 +203,3 @@ staging/staging-w35und-merge-rest-of-wbhal.c-to-phy_calibration.c.patch
#staging/staging-add-intel-poulsbo-morrestown-drm-driver.patch
-
diff --git a/staging/staging-fix-operator-precedence-errors.patch b/staging/staging-fix-operator-precedence-errors.patch
new file mode 100644
index 00000000000000..8ed03b0b0772ce
--- /dev/null
+++ b/staging/staging-fix-operator-precedence-errors.patch
@@ -0,0 +1,80 @@
+From roel.kluin@gmail.com Tue Apr 21 17:07:57 2009
+From: Roel Kluin <roel.kluin@gmail.com>
+Date: Thu, 16 Apr 2009 22:22:40 +0200
+Subject: Staging: fix operator precedence errors
+To: Greg KH <gregkh@suse.de>
+Message-ID: <49E79390.7070809@gmail.com>
+
+
+`!' has a higher precedence than `&' and `|' has a higher precedence than `?'
+
+Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/comedi/drivers/pcl816.c | 2 +-
+ drivers/staging/pohmelfs/trans.c | 3 ++-
+ drivers/staging/rt2870/tmp60 | 2 +-
+ drivers/staging/rt2870/tmp61 | 2 +-
+ drivers/staging/rt3070/sta_ioctl.c | 4 +---
+ 5 files changed, 6 insertions(+), 7 deletions(-)
+
+--- a/drivers/staging/comedi/drivers/pcl816.c
++++ b/drivers/staging/comedi/drivers/pcl816.c
+@@ -482,7 +482,7 @@ static int pcl816_ai_cmdtest(struct come
+ if (!cmd->scan_begin_src || tmp != cmd->scan_begin_src)
+ err++;
+
+- if (!cmd->convert_src & (TRIG_EXT | TRIG_TIMER))
++ if (!(cmd->convert_src & (TRIG_EXT | TRIG_TIMER)))
+ err++;
+
+ tmp = cmd->scan_end_src;
+--- a/drivers/staging/pohmelfs/trans.c
++++ b/drivers/staging/pohmelfs/trans.c
+@@ -101,7 +101,8 @@ static int netfs_trans_send_pages(struct
+ goto err_out;
+ }
+
+- msg.msg_flags = MSG_WAITALL|(attached_pages == 1)?0:MSG_MORE;
++ msg.msg_flags = MSG_WAITALL | (attached_pages == 1 ? 0 :
++ MSG_MORE);
+
+ err = kernel_sendpage(st->socket, page, 0, size, msg.msg_flags);
+ if (err <= 0) {
+--- a/drivers/staging/rt2870/tmp60
++++ b/drivers/staging/rt2870/tmp60
+@@ -1776,7 +1776,7 @@ int rt_ioctl_siwencode(struct net_device
+ }
+ else
+ /* Don't complain if only change the mode */
+- if(!erq->flags & IW_ENCODE_MODE) {
++ if(!(erq->flags & IW_ENCODE_MODE)) {
+ return -EINVAL;
+ }
+ }
+--- a/drivers/staging/rt2870/tmp61
++++ b/drivers/staging/rt2870/tmp61
+@@ -1776,7 +1776,7 @@ int rt_ioctl_siwencode(struct net_device
+ }
+ else
+ /* Don't complain if only change the mode */
+- if(!erq->flags & IW_ENCODE_MODE) {
++ if(!(erq->flags & IW_ENCODE_MODE)) {
+ return -EINVAL;
+ }
+ }
+--- a/drivers/staging/rt3070/sta_ioctl.c
++++ b/drivers/staging/rt3070/sta_ioctl.c
+@@ -1725,10 +1725,8 @@ int rt_ioctl_siwencode(struct net_device
+ }
+ else
+ /* Don't complain if only change the mode */
+- if(!erq->flags & IW_ENCODE_MODE)
+- {
++ if (!(erq->flags & IW_ENCODE_MODE))
+ return -EINVAL;
+- }
+ }
+
+ done:
diff --git a/usb.current/usb-ehci-sched.c-ehci-sitd-scheduling-bugfix.patch b/usb.current/usb-ehci-sched.c-ehci-sitd-scheduling-bugfix.patch
new file mode 100644
index 00000000000000..844feaa3727af5
--- /dev/null
+++ b/usb.current/usb-ehci-sched.c-ehci-sitd-scheduling-bugfix.patch
@@ -0,0 +1,46 @@
+From ddstreet@ieee.org Tue Apr 21 17:06:26 2009
+From: Dan Streetman <ddstreet@ieee.org>
+Date: Tue, 21 Apr 2009 13:37:12 -0400 (EDT)
+Subject: USB: ehci-sched.c: EHCI SITD scheduling bugfix
+To: David Brownell <david-b@pacbell.net>, Alan Stern <stern@rowland.harvard.edu>, Kung James <kong1191@gmail.com>, Greg KH <greg@kroah.com>
+Message-ID: <alpine.LNX.1.10.0904211333420.26609@floyd>
+
+
+Without this patch, the driver won't check that the last fully-occupied
+uframe for a new split transaction was vacant beforehand. This can
+lead to a situation in which the first 188 bytes of a 192-byte
+isochronous transfer are scheduled in the same uframe as an existing
+interrupt transfer. The resulting schedule looks like this:
+
+ uframe 0: 188-byte isoc-OUT SSPLIT, 8-byte int-IN SSPLIT
+ uframe 1: 4-byte isoc-OUT SSPLIT
+
+The SSPLITs are intermingled, causing an error in the downstream hub's
+TT.
+
+If you are having problems with devices or hub ports resetting, or failed
+interrupt transfers, when you start using a USB audio or video (Isochronous)
+device, this patch may help.
+
+
+Signed-off-by: Dan Streetman <ddstreet@ieee.org>
+Reported-by: Kung James <kong1191@gmail.com>
+Cc: David Brownell <david-b@pacbell.net>
+Cc: Alan Stern <stern@rowland.harvard.edu>
+
+
+---
+ drivers/usb/host/ehci-sched.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/host/ehci-sched.c
++++ b/drivers/usb/host/ehci-sched.c
+@@ -323,7 +323,7 @@ static int tt_available (
+ * already scheduled transactions
+ */
+ if (125 < usecs) {
+- int ufs = (usecs / 125) - 1;
++ int ufs = (usecs / 125);
+ int i;
+ for (i = uframe; i < (uframe + ufs) && i < 8; i++)
+ if (0 < tt_usecs[i]) {
diff --git a/usb.current/usb-fix-mos7840-problem-with-minor-numbers.patch b/usb.current/usb-fix-mos7840-problem-with-minor-numbers.patch
new file mode 100644
index 00000000000000..2123a90424adf4
--- /dev/null
+++ b/usb.current/usb-fix-mos7840-problem-with-minor-numbers.patch
@@ -0,0 +1,73 @@
+From linux-usb-owner@vger.kernel.org Sat Apr 18 06:12:30 2009
+From: Tony Cook <tony-cook@bigpond.com>
+Date: Sat, 18 Apr 2009 22:42:18 +0930
+Subject: USB: fix mos7840 problem with minor numbers
+Cc: Greg KH <gregkh@suse.de>
+Message-ID: <49E9D1B2.4090903@bigpond.com>
+
+
+This patch fixes a problem with any mos7840 device where the use of the field "minor" before it is
+initialised results in all the devices being overlaid in memory (minor = 0 for all instances)
+
+Contributed by: Phillip Branch
+
+Signed-off-by: Tony Cook <tony-cook@bigpond.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/mos7840.c | 30 +++++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 11 deletions(-)
+
+--- a/drivers/usb/serial/mos7840.c
++++ b/drivers/usb/serial/mos7840.c
+@@ -38,7 +38,7 @@
+ /*
+ * Version Information
+ */
+-#define DRIVER_VERSION "1.3.1"
++#define DRIVER_VERSION "1.3.2"
+ #define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver"
+
+ /*
+@@ -2484,9 +2484,14 @@ static int mos7840_startup(struct usb_se
+ mos7840_set_port_private(serial->port[i], mos7840_port);
+ spin_lock_init(&mos7840_port->pool_lock);
+
+- mos7840_port->port_num = ((serial->port[i]->number -
+- (serial->port[i]->serial->minor)) +
+- 1);
++ /* minor is not initialised until later by
++ * usb-serial.c:get_free_serial() and cannot therefore be used
++ * to index device instances */
++ mos7840_port->port_num = i + 1;
++ dbg ("serial->port[i]->number = %d", serial->port[i]->number);
++ dbg ("serial->port[i]->serial->minor = %d", serial->port[i]->serial->minor);
++ dbg ("mos7840_port->port_num = %d", mos7840_port->port_num);
++ dbg ("serial->minor = %d", serial->minor);
+
+ if (mos7840_port->port_num == 1) {
+ mos7840_port->SpRegOffset = 0x0;
+@@ -2697,13 +2702,16 @@ static void mos7840_shutdown(struct usb_
+
+ for (i = 0; i < serial->num_ports; ++i) {
+ mos7840_port = mos7840_get_port_private(serial->port[i]);
+- spin_lock_irqsave(&mos7840_port->pool_lock, flags);
+- mos7840_port->zombie = 1;
+- spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
+- usb_kill_urb(mos7840_port->control_urb);
+- kfree(mos7840_port->ctrl_buf);
+- kfree(mos7840_port->dr);
+- kfree(mos7840_port);
++ dbg ("mos7840_port %d = %p", i, mos7840_port);
++ if (mos7840_port) {
++ spin_lock_irqsave(&mos7840_port->pool_lock, flags);
++ mos7840_port->zombie = 1;
++ spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
++ usb_kill_urb(mos7840_port->control_urb);
++ kfree(mos7840_port->ctrl_buf);
++ kfree(mos7840_port->dr);
++ kfree(mos7840_port);
++ }
+ mos7840_set_port_private(serial->port[i], NULL);
+ }
+
diff --git a/usb.current/usb-g_file_storage-fix-use-after-free-bug-when-closing-files.patch b/usb.current/usb-g_file_storage-fix-use-after-free-bug-when-closing-files.patch
new file mode 100644
index 00000000000000..2fa078d690d7ee
--- /dev/null
+++ b/usb.current/usb-g_file_storage-fix-use-after-free-bug-when-closing-files.patch
@@ -0,0 +1,92 @@
+From stern@rowland.harvard.edu Tue Apr 21 17:09:05 2009
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Thu, 16 Apr 2009 15:37:28 -0400 (EDT)
+Subject: USB: g_file_storage: fix use-after-free bug when closing files
+To: Greg KH <greg@kroah.com>
+Cc: USB list <linux-usb@vger.kernel.org>, <stable@kernel.org>
+Message-ID: <Pine.LNX.4.44L0.0904161535110.2718-100000@iolanthe.rowland.org>
+
+
+This patch (as1231) fixes a use-after-free bug in g_file_storage. A
+device's name may not be available after the device is unregistered,
+even if the device structure itself is still allocated. Since
+close_backing_file() prints a LUN's name for debugging, it shouldn't
+be called after the LUN has been unregistered.
+
+That whole area needed to be cleaned up; the backing files were
+getting closed in a couple of different places. The patch fixes
+things so that they get closed in just one place, as part of the
+unbind procedure, immediately before the LUN is unregistered.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/file_storage.c | 20 ++++----------------
+ 1 file changed, 4 insertions(+), 16 deletions(-)
+
+--- a/drivers/usb/gadget/file_storage.c
++++ b/drivers/usb/gadget/file_storage.c
+@@ -738,7 +738,6 @@ static struct fsg_dev *the_fsg;
+ static struct usb_gadget_driver fsg_driver;
+
+ static void close_backing_file(struct lun *curlun);
+-static void close_all_backing_files(struct fsg_dev *fsg);
+
+
+ /*-------------------------------------------------------------------------*/
+@@ -3593,12 +3592,10 @@ static int fsg_main_thread(void *fsg_)
+ fsg->thread_task = NULL;
+ spin_unlock_irq(&fsg->lock);
+
+- /* In case we are exiting because of a signal, unregister the
+- * gadget driver and close the backing file. */
+- if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags)) {
++ /* If we are exiting because of a signal, unregister the
++ * gadget driver. */
++ if (test_and_clear_bit(REGISTERED, &fsg->atomic_bitflags))
+ usb_gadget_unregister_driver(&fsg_driver);
+- close_all_backing_files(fsg);
+- }
+
+ /* Let the unbind and cleanup routines know the thread has exited */
+ complete_and_exit(&fsg->thread_notifier, 0);
+@@ -3703,14 +3700,6 @@ static void close_backing_file(struct lu
+ }
+ }
+
+-static void close_all_backing_files(struct fsg_dev *fsg)
+-{
+- int i;
+-
+- for (i = 0; i < fsg->nluns; ++i)
+- close_backing_file(&fsg->luns[i]);
+-}
+-
+
+ static ssize_t show_ro(struct device *dev, struct device_attribute *attr, char *buf)
+ {
+@@ -3845,6 +3834,7 @@ static void /* __init_or_exit */ fsg_unb
+ if (curlun->registered) {
+ device_remove_file(&curlun->dev, &dev_attr_ro);
+ device_remove_file(&curlun->dev, &dev_attr_file);
++ close_backing_file(curlun);
+ device_unregister(&curlun->dev);
+ curlun->registered = 0;
+ }
+@@ -4190,7 +4180,6 @@ autoconf_fail:
+ out:
+ fsg->state = FSG_STATE_TERMINATED; // The thread is dead
+ fsg_unbind(gadget);
+- close_all_backing_files(fsg);
+ complete(&fsg->thread_notifier);
+ return rc;
+ }
+@@ -4284,7 +4273,6 @@ static void __exit fsg_cleanup(void)
+ /* Wait for the thread to finish up */
+ wait_for_completion(&fsg->thread_notifier);
+
+- close_all_backing_files(fsg);
+ kref_put(&fsg->ref, fsg_release);
+ }
+ module_exit(fsg_cleanup);
diff --git a/usb.current/usb-mos7840-add-new-device-id.patch b/usb.current/usb-mos7840-add-new-device-id.patch
new file mode 100644
index 00000000000000..123254f1a9c911
--- /dev/null
+++ b/usb.current/usb-mos7840-add-new-device-id.patch
@@ -0,0 +1,51 @@
+From linux-usb-owner@vger.kernel.org Sat Apr 18 06:12:30 2009
+From: Tony Cook <tony-cook@bigpond.com>
+Date: Sat, 18 Apr 2009 22:42:18 +0930
+Subject: USB: mos7840: add new device id
+Cc: Greg KH <gregkh@suse.de>
+Message-ID: <49E9D1B2.4090903@bigpond.com>
+
+
+add USB ids for the mos7840 based ATEN International serial devices.
+
+Contributed by: Phillip Branch
+
+
+Signed-off-by: Tony Cook <tony-cook@bigpond.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/usb/serial/mos7840.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/usb/serial/mos7840.c
++++ b/drivers/usb/serial/mos7840.c
+@@ -123,6 +123,11 @@
+ #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
+ #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
+
++/* This driver also supports the ATEN UC2324 device since it is mos7840 based
++ * - if I knew the device id it would also support the ATEN UC2322 */
++#define USB_VENDOR_ID_ATENINTL 0x0557
++#define ATENINTL_DEVICE_ID_UC2324 0x2011
++
+ /* Interrupt Routine Defines */
+
+ #define SERIAL_IIR_RLS 0x06
+@@ -170,6 +175,7 @@ static struct usb_device_id moschip_port
+ {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
++ {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
+ {} /* terminating entry */
+ };
+
+@@ -178,6 +184,7 @@ static __devinitdata struct usb_device_i
+ {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
+ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
++ {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
+ {} /* terminating entry */
+ };
+
diff --git a/usb.current/usb-mos7840-fix-debug-log-messages.patch b/usb.current/usb-mos7840-fix-debug-log-messages.patch
new file mode 100644
index 00000000000000..9e27511959b174
--- /dev/null
+++ b/usb.current/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;
+ }
+
+@@ -1049,12 +1051,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 */
+@@ -1067,7 +1069,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);
+@@ -1093,9 +1095,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;
+
+ }
+@@ -1118,16 +1122,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;
+ }
+
+@@ -1196,16 +1200,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;
+ }
+
+@@ -1237,27 +1241,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);
+ }
+ }
+@@ -1277,7 +1281,7 @@ static void mos7840_close(struct tty_str
+
+ mos7840_port->open = 0;
+
+- dbg("%s \n", "Leaving ............");
++ dbg("%s", "Leaving ............");
+ }
+
+ /************************************************************************
+@@ -1332,17 +1336,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;
+ }
+
+@@ -1362,7 +1366,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);
+@@ -1386,17 +1390,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;
+ }
+
+@@ -1436,16 +1440,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; */
+@@ -1459,32 +1463,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;
+ }
+
+@@ -1496,7 +1500,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;
+ }
+ }
+@@ -1531,7 +1535,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);
+@@ -1546,7 +1550,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;
+
+@@ -1565,11 +1569,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);
+
+@@ -1577,11 +1581,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)) {
+@@ -1615,7 +1619,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;
+ }
+
+@@ -1627,7 +1631,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)) {
+@@ -1712,7 +1716,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;
+ }
+
+@@ -1781,11 +1785,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
+ }
+@@ -1811,16 +1815,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;
+
+@@ -1836,7 +1840,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
+@@ -1849,7 +1853,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
+@@ -1864,14 +1868,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 */
+@@ -1887,11 +1891,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 */
+@@ -1929,12 +1933,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;
+ }
+
+@@ -1947,7 +1951,7 @@ static void mos7840_change_port_settings
+ return;
+ }
+
+- dbg("%s", "Entering .......... \n");
++ dbg("%s", "Entering ..........");
+
+ lData = LCR_BITS_8;
+ lStop = LCR_STOP_1;
+@@ -2007,7 +2011,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;
+@@ -2049,7 +2053,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;
+ }
+
+@@ -2072,7 +2076,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;
+@@ -2092,16 +2096,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;
+ }
+
+@@ -2115,7 +2119,7 @@ static void mos7840_set_termios(struct t
+ return;
+ }
+
+- dbg("%s\n", "setting termios - ");
++ dbg("%s", "setting termios - ");
+
+ cflag = tty->termios->c_cflag;
+
+@@ -2130,7 +2134,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;
+ }
+
+@@ -2196,7 +2200,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;
+ }
+
+@@ -2241,7 +2245,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;
+ }
+
+@@ -2326,7 +2330,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;
+ }
+
+@@ -2426,9 +2430,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;
+@@ -2437,7 +2440,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;
+ }
+
+@@ -2452,22 +2455,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__);
+@@ -2525,10 +2530,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
+@@ -2538,10 +2543,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
+@@ -2550,48 +2555,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 */
+@@ -2599,11 +2604,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 */
+@@ -2614,30 +2619,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);
+
+ }
+@@ -2651,15 +2656,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),
+@@ -2688,10 +2694,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;
+ }
+
+@@ -2715,7 +2721,7 @@ static void mos7840_shutdown(struct usb_
+ mos7840_set_port_private(serial->port[i], NULL);
+ }
+
+- dbg("%s\n", "Thank u :: ");
++ dbg("%s", "Thank u :: ");
+
+ }
+
+@@ -2766,7 +2772,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);
+@@ -2774,14 +2780,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);
+@@ -2796,13 +2802,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);
diff --git a/usb.current/usb-pass-mem_flags-to-dma_alloc_coherent.patch b/usb.current/usb-pass-mem_flags-to-dma_alloc_coherent.patch
new file mode 100644
index 00000000000000..9860af4ce8c377
--- /dev/null
+++ b/usb.current/usb-pass-mem_flags-to-dma_alloc_coherent.patch
@@ -0,0 +1,44 @@
+From johannes@sipsolutions.net Tue Apr 21 17:10:41 2009
+From: Johannes Berg <johannes@sipsolutions.net>
+Date: Sat, 18 Apr 2009 11:00:39 +0200
+Subject: USB: pass mem_flags to dma_alloc_coherent
+Message-ID: <1240045239.5792.2.camel@johannes.local>
+
+
+When I want to use my webcam, I get:
+
+ vvvvvvv
+cheese: page allocation failure. order:5, mode:0x8004
+Pid: 8100, comm: cheese Not tainted 2.6.30-rc2-wl-dirty #102
+Call Trace:
+ [<ffffffff802c5d8e>] __alloc_pages_internal+0x3fe/0x520
+ [<ffffffff80210a20>] dma_generic_alloc_coherent+0x90/0x120
+ [<ffffffffa001c91e>] hcd_buffer_alloc+0xee/0x130 [usbcore]
+ [<ffffffffa000d52d>] usb_buffer_alloc+0x2d/0x40 [usbcore]
+ [<ffffffffa0160e14>] uvc_alloc_urb_buffers+0x84/0x140 [uvcvideo]
+ [<ffffffffa0160ff6>] uvc_init_video+0x126/0x400 [uvcvideo]
+ [...]
+
+Oddly, I remembered fixing this and putting in __GFP_NOWARN
+because uvcvideo retries a smaller allocation. However, the
+allocation function doesn't pass the gfp flags through to
+dma_alloc_coherent so we still get the warning!
+
+Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/buffer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/core/buffer.c
++++ b/drivers/usb/core/buffer.c
+@@ -119,7 +119,7 @@ void *hcd_buffer_alloc(
+ if (size <= pool_max [i])
+ return dma_pool_alloc(hcd->pool [i], mem_flags, dma);
+ }
+- return dma_alloc_coherent(hcd->self.controller, size, dma, 0);
++ return dma_alloc_coherent(hcd->self.controller, size, dma, mem_flags);
+ }
+
+ void hcd_buffer_free(
diff --git a/usb/usb-consolidate-usb_unbind_interface-and-usb_driver_release_interface.patch b/usb/usb-consolidate-usb_unbind_interface-and-usb_driver_release_interface.patch
new file mode 100644
index 00000000000000..05d9114f536eaf
--- /dev/null
+++ b/usb/usb-consolidate-usb_unbind_interface-and-usb_driver_release_interface.patch
@@ -0,0 +1,71 @@
+From stern@rowland.harvard.edu Tue Apr 21 17:08:39 2009
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Thu, 16 Apr 2009 15:35:09 -0400 (EDT)
+Subject: USB: consolidate usb_unbind_interface and usb_driver_release_interface
+To: Greg KH <greg@kroah.com>
+Message-ID: <Pine.LNX.4.44L0.0904161532160.2718-100000@iolanthe.rowland.org>
+
+
+This patch (as1230) consolidates code in usb_unbind_interface() and
+usb_driver_release_interface(). In fact, it makes release_interface
+call unbind_interface, thereby removing the need for duplicated code.
+
+It works like this: If the interface has already been registered with
+the driver core when a driver releases it, then the usual driver-core
+mechanism will call unbind_interface. If it hasn't been unregistered
+then we will make the call ourselves.
+
+As a nice bonus, drivers now don't have to worry about whether their
+disconnect method will get called when they release an interface -- it
+always will. Previously it would be called only if the interface was
+registered.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/driver.c | 21 ++++++++-------------
+ 1 file changed, 8 insertions(+), 13 deletions(-)
+
+--- a/drivers/usb/core/driver.c
++++ b/drivers/usb/core/driver.c
+@@ -385,7 +385,6 @@ void usb_driver_release_interface(struct
+ struct usb_interface *iface)
+ {
+ struct device *dev = &iface->dev;
+- struct usb_device *udev = interface_to_usbdev(iface);
+
+ /* this should never happen, don't release something that's not ours */
+ if (!dev->driver || dev->driver != &driver->drvwrap.driver)
+@@ -394,23 +393,19 @@ void usb_driver_release_interface(struct
+ /* don't release from within disconnect() */
+ if (iface->condition != USB_INTERFACE_BOUND)
+ return;
++ iface->condition = USB_INTERFACE_UNBINDING;
+
+- /* don't release if the interface hasn't been added yet */
++ /* Release via the driver core only if the interface
++ * has already been registered
++ */
+ if (device_is_registered(dev)) {
+- iface->condition = USB_INTERFACE_UNBINDING;
+ device_release_driver(dev);
+ } else {
+- iface->condition = USB_INTERFACE_UNBOUND;
+- usb_cancel_queued_reset(iface);
++ down(&dev->sem);
++ usb_unbind_interface(dev);
++ dev->driver = NULL;
++ up(&dev->sem);
+ }
+- dev->driver = NULL;
+- usb_set_intfdata(iface, NULL);
+-
+- usb_pm_lock(udev);
+- iface->condition = USB_INTERFACE_UNBOUND;
+- mark_quiesced(iface);
+- iface->needs_remote_wakeup = 0;
+- usb_pm_unlock(udev);
+ }
+ EXPORT_SYMBOL_GPL(usb_driver_release_interface);
+