Commit a80be97d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: serial: usb_wwan.c: remove dbg() usage

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" <bjorn@mork.no>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
CC: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7b5ba275
...@@ -178,7 +178,7 @@ int usb_wwan_ioctl(struct tty_struct *tty, ...@@ -178,7 +178,7 @@ int usb_wwan_ioctl(struct tty_struct *tty,
{ {
struct usb_serial_port *port = tty->driver_data; 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) { switch (cmd) {
case TIOCGSERIAL: case TIOCGSERIAL:
...@@ -191,7 +191,7 @@ int usb_wwan_ioctl(struct tty_struct *tty, ...@@ -191,7 +191,7 @@ int usb_wwan_ioctl(struct tty_struct *tty,
break; break;
} }
dbg("%s arg not supported", __func__); dev_dbg(&port->dev, "%s arg not supported\n", __func__);
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
...@@ -212,7 +212,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -212,7 +212,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
intfdata = port->serial->private; intfdata = port->serial->private;
dbg("%s: write (%d chars)", __func__, count); dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count);
i = 0; i = 0;
left = count; left = count;
...@@ -229,8 +229,8 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -229,8 +229,8 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
usb_unlink_urb(this_urb); usb_unlink_urb(this_urb);
continue; continue;
} }
dbg("%s: endpoint %d buf %d", __func__, dev_dbg(&port->dev, "%s: endpoint %d buf %d\n", __func__,
usb_pipeendpoint(this_urb->pipe), i); usb_pipeendpoint(this_urb->pipe), i);
err = usb_autopm_get_interface_async(port->serial->interface); err = usb_autopm_get_interface_async(port->serial->interface);
if (err < 0) if (err < 0)
...@@ -249,8 +249,9 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -249,8 +249,9 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
spin_unlock_irqrestore(&intfdata->susp_lock, flags); spin_unlock_irqrestore(&intfdata->susp_lock, flags);
err = usb_submit_urb(this_urb, GFP_ATOMIC); err = usb_submit_urb(this_urb, GFP_ATOMIC);
if (err) { if (err) {
dbg("usb_submit_urb %p (write bulk) failed " dev_dbg(&port->dev,
"(%d)", this_urb, err); "usb_submit_urb %p (write bulk) failed (%d)\n",
this_urb, err);
clear_bit(i, &portdata->out_busy); clear_bit(i, &portdata->out_busy);
spin_lock_irqsave(&intfdata->susp_lock, flags); spin_lock_irqsave(&intfdata->susp_lock, flags);
intfdata->in_flight--; intfdata->in_flight--;
...@@ -267,7 +268,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -267,7 +268,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
} }
count -= left; count -= left;
dbg("%s: wrote (did %d)", __func__, count); dev_dbg(&port->dev, "%s: wrote (did %d)\n", __func__, count);
return count; return count;
} }
EXPORT_SYMBOL(usb_wwan_write); EXPORT_SYMBOL(usb_wwan_write);
...@@ -278,15 +279,17 @@ static void usb_wwan_indat_callback(struct urb *urb) ...@@ -278,15 +279,17 @@ static void usb_wwan_indat_callback(struct urb *urb)
int endpoint; int endpoint;
struct usb_serial_port *port; struct usb_serial_port *port;
struct tty_struct *tty; struct tty_struct *tty;
struct device *dev;
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
int status = urb->status; int status = urb->status;
endpoint = usb_pipeendpoint(urb->pipe); endpoint = usb_pipeendpoint(urb->pipe);
port = urb->context; port = urb->context;
dev = &port->dev;
if (status) { if (status) {
dbg("%s: nonzero status: %d on endpoint %02x.", dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n",
__func__, status, endpoint); __func__, status, endpoint);
} else { } else {
tty = tty_port_tty_get(&port->port); tty = tty_port_tty_get(&port->port);
if (tty) { if (tty) {
...@@ -295,7 +298,7 @@ static void usb_wwan_indat_callback(struct urb *urb) ...@@ -295,7 +298,7 @@ static void usb_wwan_indat_callback(struct urb *urb)
urb->actual_length); urb->actual_length);
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
} else } else
dbg("%s: empty read urb received", __func__); dev_dbg(dev, "%s: empty read urb received\n", __func__);
tty_kref_put(tty); tty_kref_put(tty);
} }
...@@ -303,8 +306,7 @@ static void usb_wwan_indat_callback(struct urb *urb) ...@@ -303,8 +306,7 @@ static void usb_wwan_indat_callback(struct urb *urb)
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) { if (err) {
if (err != -EPERM) { if (err != -EPERM) {
printk(KERN_ERR "%s: resubmit read urb failed. " dev_err(dev, "%s: resubmit read urb failed. (%d)\n", __func__, err);
"(%d)", __func__, err);
/* busy also in error unless we are killed */ /* busy also in error unless we are killed */
usb_mark_last_busy(port->serial->dev); usb_mark_last_busy(port->serial->dev);
} }
...@@ -356,7 +358,7 @@ int usb_wwan_write_room(struct tty_struct *tty) ...@@ -356,7 +358,7 @@ int usb_wwan_write_room(struct tty_struct *tty)
data_len += OUT_BUFLEN; data_len += OUT_BUFLEN;
} }
dbg("%s: %d", __func__, data_len); dev_dbg(&port->dev, "%s: %d\n", __func__, data_len);
return data_len; return data_len;
} }
EXPORT_SYMBOL(usb_wwan_write_room); EXPORT_SYMBOL(usb_wwan_write_room);
...@@ -378,7 +380,7 @@ int usb_wwan_chars_in_buffer(struct tty_struct *tty) ...@@ -378,7 +380,7 @@ int usb_wwan_chars_in_buffer(struct tty_struct *tty)
if (this_urb && test_bit(i, &portdata->out_busy)) if (this_urb && test_bit(i, &portdata->out_busy))
data_len += this_urb->transfer_buffer_length; 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; return data_len;
} }
EXPORT_SYMBOL(usb_wwan_chars_in_buffer); EXPORT_SYMBOL(usb_wwan_chars_in_buffer);
...@@ -401,8 +403,8 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -401,8 +403,8 @@ int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
continue; continue;
err = usb_submit_urb(urb, GFP_KERNEL); err = usb_submit_urb(urb, GFP_KERNEL);
if (err) { if (err) {
dbg("%s: submit urb %d failed (%d) %d", dev_dbg(&port->dev, "%s: submit urb %d failed (%d) %d\n",
__func__, i, err, urb->transfer_buffer_length); __func__, i, err, urb->transfer_buffer_length);
} }
} }
...@@ -458,7 +460,9 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint, ...@@ -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 */ urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
if (urb == NULL) { 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; return NULL;
} }
...@@ -522,8 +526,8 @@ int usb_wwan_startup(struct usb_serial *serial) ...@@ -522,8 +526,8 @@ int usb_wwan_startup(struct usb_serial *serial)
port = serial->port[i]; port = serial->port[i];
portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
if (!portdata) { if (!portdata) {
dbg("%s: kmalloc for usb_wwan_port_private (%d) failed!.", dev_dbg(&port->dev, "%s: kmalloc for usb_wwan_port_private (%d) failed!.\n",
__func__, i); __func__, i);
return 1; return 1;
} }
init_usb_anchor(&portdata->delayed); init_usb_anchor(&portdata->delayed);
...@@ -548,7 +552,8 @@ int usb_wwan_startup(struct usb_serial *serial) ...@@ -548,7 +552,8 @@ int usb_wwan_startup(struct usb_serial *serial)
continue; continue;
err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (err) 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); usb_wwan_setup_urbs(serial);
return 0; return 0;
...@@ -683,11 +688,11 @@ int usb_wwan_resume(struct usb_serial *serial) ...@@ -683,11 +688,11 @@ int usb_wwan_resume(struct usb_serial *serial)
for (i = 0; i < serial->num_ports; i++) { for (i = 0; i < serial->num_ports; i++) {
port = serial->port[i]; port = serial->port[i];
if (!port->interrupt_in_urb) { 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; continue;
} }
err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); 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) { if (err < 0) {
dev_err(&port->dev, "%s: Error %d for interrupt URB\n", dev_err(&port->dev, "%s: Error %d for interrupt URB\n",
__func__, err); __func__, err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment