From a80be97d0a37c1f93efc233f78722b03faedb2ed Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 13 Sep 2012 17:41:50 -0700 Subject: USB: serial: usb_wwan.c: remove dbg() usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dbg() was a very old USB-serial-specific macro. This patch removes it from being used in the driver and uses dev_dbg() instead. CC: "Bjørn Mork" CC: Rusty Russell CC: Mauro Carvalho Chehab CC: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb_wwan.c | 51 ++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 23 deletions(-) (limited to 'drivers/usb/serial/usb_wwan.c') diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 6855d5ed0331..3520effb3aa3 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -178,7 +178,7 @@ int usb_wwan_ioctl(struct tty_struct *tty, { struct usb_serial_port *port = tty->driver_data; - dbg("%s cmd 0x%04x", __func__, cmd); + dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd); switch (cmd) { case TIOCGSERIAL: @@ -191,7 +191,7 @@ int usb_wwan_ioctl(struct tty_struct *tty, break; } - dbg("%s arg not supported", __func__); + dev_dbg(&port->dev, "%s arg not supported\n", __func__); return -ENOIOCTLCMD; } @@ -212,7 +212,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, portdata = usb_get_serial_port_data(port); intfdata = port->serial->private; - dbg("%s: write (%d chars)", __func__, count); + dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count); i = 0; left = count; @@ -229,8 +229,8 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, usb_unlink_urb(this_urb); continue; } - dbg("%s: endpoint %d buf %d", __func__, - usb_pipeendpoint(this_urb->pipe), i); + dev_dbg(&port->dev, "%s: endpoint %d buf %d\n", __func__, + usb_pipeendpoint(this_urb->pipe), i); err = usb_autopm_get_interface_async(port->serial->interface); if (err < 0) @@ -249,8 +249,9 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, spin_unlock_irqrestore(&intfdata->susp_lock, flags); err = usb_submit_urb(this_urb, GFP_ATOMIC); if (err) { - dbg("usb_submit_urb %p (write bulk) failed " - "(%d)", this_urb, err); + dev_dbg(&port->dev, + "usb_submit_urb %p (write bulk) failed (%d)\n", + this_urb, err); clear_bit(i, &portdata->out_busy); spin_lock_irqsave(&intfdata->susp_lock, flags); intfdata->in_flight--; @@ -267,7 +268,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, } count -= left; - dbg("%s: wrote (did %d)", __func__, count); + dev_dbg(&port->dev, "%s: wrote (did %d)\n", __func__, count); return count; } EXPORT_SYMBOL(usb_wwan_write); @@ -278,15 +279,17 @@ static void usb_wwan_indat_callback(struct urb *urb) int endpoint; struct usb_serial_port *port; struct tty_struct *tty; + struct device *dev; unsigned char *data = urb->transfer_buffer; int status = urb->status; endpoint = usb_pipeendpoint(urb->pipe); port = urb->context; + dev = &port->dev; if (status) { - dbg("%s: nonzero status: %d on endpoint %02x.", - __func__, status, endpoint); + dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n", + __func__, status, endpoint); } else { tty = tty_port_tty_get(&port->port); if (tty) { @@ -295,7 +298,7 @@ static void usb_wwan_indat_callback(struct urb *urb) urb->actual_length); tty_flip_buffer_push(tty); } else - dbg("%s: empty read urb received", __func__); + dev_dbg(dev, "%s: empty read urb received\n", __func__); tty_kref_put(tty); } @@ -303,8 +306,7 @@ static void usb_wwan_indat_callback(struct urb *urb) err = usb_submit_urb(urb, GFP_ATOMIC); if (err) { if (err != -EPERM) { - printk(KERN_ERR "%s: resubmit read urb failed. " - "(%d)", __func__, err); + dev_err(dev, "%s: resubmit read urb failed. (%d)\n", __func__, err); /* busy also in error unless we are killed */ usb_mark_last_busy(port->serial->dev); } @@ -356,7 +358,7 @@ int usb_wwan_write_room(struct tty_struct *tty) data_len += OUT_BUFLEN; } - dbg("%s: %d", __func__, data_len); + dev_dbg(&port->dev, "%s: %d\n", __func__, data_len); return data_len; } EXPORT_SYMBOL(usb_wwan_write_room); @@ -378,7 +380,7 @@ int usb_wwan_chars_in_buffer(struct tty_struct *tty) if (this_urb && test_bit(i, &portdata->out_busy)) data_len += this_urb->transfer_buffer_length; } - dbg("%s: %d", __func__, data_len); + dev_dbg(&port->dev, "%s: %d\n", __func__, data_len); return data_len; } EXPORT_SYMBOL(usb_wwan_chars_in_buffer); @@ -401,8 +403,8 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port) continue; err = usb_submit_urb(urb, GFP_KERNEL); if (err) { - dbg("%s: submit urb %d failed (%d) %d", - __func__, i, err, urb->transfer_buffer_length); + dev_dbg(&port->dev, "%s: submit urb %d failed (%d) %d\n", + __func__, i, err, urb->transfer_buffer_length); } } @@ -458,7 +460,9 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint, urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ if (urb == NULL) { - dbg("%s: alloc for endpoint %d failed.", __func__, endpoint); + dev_dbg(&serial->interface->dev, + "%s: alloc for endpoint %d failed.\n", __func__, + endpoint); return NULL; } @@ -522,8 +526,8 @@ int usb_wwan_startup(struct usb_serial *serial) port = serial->port[i]; portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); if (!portdata) { - dbg("%s: kmalloc for usb_wwan_port_private (%d) failed!.", - __func__, i); + dev_dbg(&port->dev, "%s: kmalloc for usb_wwan_port_private (%d) failed!.\n", + __func__, i); return 1; } init_usb_anchor(&portdata->delayed); @@ -548,7 +552,8 @@ int usb_wwan_startup(struct usb_serial *serial) continue; err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (err) - dbg("%s: submit irq_in urb failed %d", __func__, err); + dev_dbg(&port->dev, "%s: submit irq_in urb failed %d\n", + __func__, err); } usb_wwan_setup_urbs(serial); return 0; @@ -683,11 +688,11 @@ int usb_wwan_resume(struct usb_serial *serial) for (i = 0; i < serial->num_ports; i++) { port = serial->port[i]; if (!port->interrupt_in_urb) { - dbg("%s: No interrupt URB for port %d", __func__, i); + dev_dbg(&port->dev, "%s: No interrupt URB for port\n", __func__); continue; } err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); - dbg("Submitted interrupt URB for port %d (result %d)", i, err); + dev_dbg(&port->dev, "Submitted interrupt URB for port (result %d)\n", err); if (err < 0) { dev_err(&port->dev, "%s: Error %d for interrupt URB\n", __func__, err); -- cgit v1.2.3 From 061b2a22bc9a22c2571e603d9f66dce2d4e156a5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 14 Sep 2012 12:32:03 -0700 Subject: USB: serial: usb_wwan.c: remove debug module parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that the dbg() macro is no longer being used in the driver, the debug module parameter doesn't do anything at all. So remove it so as to not confuse people. CC: "Bjørn Mork" CC: Rusty Russell CC: Mauro Carvalho Chehab CC: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb_wwan.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/usb/serial/usb_wwan.c') diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 3520effb3aa3..bc58d4a0cee5 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -37,8 +37,6 @@ #include #include "usb-wwan.h" -static bool debug; - void usb_wwan_dtr_rts(struct usb_serial_port *port, int on) { struct usb_serial *serial = port->serial; @@ -738,6 +736,3 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_VERSION(DRIVER_VERSION); MODULE_LICENSE("GPL"); - -module_param(debug, bool, S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(debug, "Debug messages"); -- cgit v1.2.3