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

USB: pl2303 driver: fixed __FUNCTION__ usages.

parent b5c3bf7a
...@@ -168,7 +168,7 @@ static int set_control_lines (struct usb_device *dev, u8 value) ...@@ -168,7 +168,7 @@ static int set_control_lines (struct usb_device *dev, u8 value)
retval = usb_control_msg (dev, usb_sndctrlpipe (dev, 0), retval = usb_control_msg (dev, usb_sndctrlpipe (dev, 0),
SET_CONTROL_REQUEST, SET_CONTROL_REQUEST_TYPE, SET_CONTROL_REQUEST, SET_CONTROL_REQUEST_TYPE,
value, 0, NULL, 0, 100); value, 0, NULL, 0, 100);
dbg (__FUNCTION__" - value = %d, retval = %d", value, retval); dbg("%s - value = %d, retval = %d", __FUNCTION__, value, retval);
return retval; return retval;
} }
...@@ -176,10 +176,10 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns ...@@ -176,10 +176,10 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns
{ {
int result; int result;
dbg (__FUNCTION__ " - port %d, %d bytes", port->number, count); dbg("%s - port %d, %d bytes", __FUNCTION__, port->number, count);
if (port->write_urb->status == -EINPROGRESS) { if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing"); dbg("%s - already writing", __FUNCTION__);
return 0; return 0;
} }
...@@ -197,7 +197,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns ...@@ -197,7 +197,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns
port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev;
result = usb_submit_urb (port->write_urb, GFP_ATOMIC); result = usb_submit_urb (port->write_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
else else
result = count; result = count;
...@@ -215,11 +215,11 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -215,11 +215,11 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
int baud; int baud;
int i; int i;
dbg (__FUNCTION__ " - port %d, initialized = %d", port->number, dbg("%s - port %d, initialized = %d", __FUNCTION__, port->number,
((struct pl2303_private *) port->private)->termios_initialized); ((struct pl2303_private *) port->private)->termios_initialized);
if ((!port->tty) || (!port->tty->termios)) { if ((!port->tty) || (!port->tty->termios)) {
dbg(__FUNCTION__" - no tty structures"); dbg("%s - no tty structures", __FUNCTION__);
return; return;
} }
...@@ -233,14 +233,14 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -233,14 +233,14 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
if (old_termios) { if (old_termios) {
if ((cflag == old_termios->c_cflag) && if ((cflag == old_termios->c_cflag) &&
(RELEVANT_IFLAG(port->tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) { (RELEVANT_IFLAG(port->tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) {
dbg(__FUNCTION__ " - nothing to change..."); dbg("%s - nothing to change...", __FUNCTION__);
return; return;
} }
} }
buf = kmalloc (7, GFP_KERNEL); buf = kmalloc (7, GFP_KERNEL);
if (!buf) { if (!buf) {
err(__FUNCTION__ " - out of memory."); err("%s - out of memory.", __FUNCTION__);
return; return;
} }
memset (buf, 0x00, 0x07); memset (buf, 0x00, 0x07);
...@@ -266,7 +266,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -266,7 +266,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
default: default:
case CS8: buf[6] = 8; break; case CS8: buf[6] = 8; break;
} }
dbg (__FUNCTION__ " - data bits = %d", buf[6]); dbg("%s - data bits = %d", __FUNCTION__, buf[6]);
} }
baud = 0; baud = 0;
...@@ -291,7 +291,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -291,7 +291,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
err ("pl2303 driver does not support the baudrate requested (fix it)"); err ("pl2303 driver does not support the baudrate requested (fix it)");
break; break;
} }
dbg (__FUNCTION__ " - baud = %d", baud); dbg("%s - baud = %d", __FUNCTION__, baud);
if (baud) { if (baud) {
buf[0] = baud & 0xff; buf[0] = baud & 0xff;
buf[1] = (baud >> 8) & 0xff; buf[1] = (baud >> 8) & 0xff;
...@@ -304,10 +304,10 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -304,10 +304,10 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
/* For reference buf[4]=2 is 2 stop bits */ /* For reference buf[4]=2 is 2 stop bits */
if (cflag & CSTOPB) { if (cflag & CSTOPB) {
buf[4] = 2; buf[4] = 2;
dbg(__FUNCTION__ " - stop bits = 2"); dbg("%s - stop bits = 2", __FUNCTION__);
} else { } else {
buf[4] = 0; buf[4] = 0;
dbg(__FUNCTION__ " - stop bits = 1"); dbg("%s - stop bits = 1", __FUNCTION__);
} }
if (cflag & PARENB) { if (cflag & PARENB) {
...@@ -318,14 +318,14 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -318,14 +318,14 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
/* For reference buf[5]=4 is space parity */ /* For reference buf[5]=4 is space parity */
if (cflag & PARODD) { if (cflag & PARODD) {
buf[5] = 1; buf[5] = 1;
dbg(__FUNCTION__ " - parity = odd"); dbg("%s - parity = odd", __FUNCTION__);
} else { } else {
buf[5] = 2; buf[5] = 2;
dbg(__FUNCTION__ " - parity = even"); dbg("%s - parity = even", __FUNCTION__);
} }
} else { } else {
buf[5] = 0; buf[5] = 0;
dbg(__FUNCTION__ " - parity = none"); dbg("%s - parity = none", __FUNCTION__);
} }
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0), i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
...@@ -371,7 +371,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -371,7 +371,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV; return -ENODEV;
dbg (__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
#define FISH(a,b,c,d) \ #define FISH(a,b,c,d) \
result=usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev,0), \ result=usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev,0), \
...@@ -402,20 +402,20 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -402,20 +402,20 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
//FIXME: need to assert RTS and DTR if CRTSCTS off //FIXME: need to assert RTS and DTR if CRTSCTS off
dbg (__FUNCTION__ " - submitting read urb"); dbg("%s - submitting read urb", __FUNCTION__);
port->read_urb->dev = serial->dev; port->read_urb->dev = serial->dev;
result = usb_submit_urb (port->read_urb, GFP_KERNEL); result = usb_submit_urb (port->read_urb, GFP_KERNEL);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting read urb, error %d", result); err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
pl2303_close (port, NULL); pl2303_close (port, NULL);
return -EPROTO; return -EPROTO;
} }
dbg (__FUNCTION__ " - submitting interrupt urb"); dbg("%s - submitting interrupt urb", __FUNCTION__);
port->interrupt_in_urb->dev = serial->dev; port->interrupt_in_urb->dev = serial->dev;
result = usb_submit_urb (port->interrupt_in_urb, GFP_KERNEL); result = usb_submit_urb (port->interrupt_in_urb, GFP_KERNEL);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting interrupt urb, error %d", result); err("%s - failed submitting interrupt urb, error %d", __FUNCTION__, result);
pl2303_close (port, NULL); pl2303_close (port, NULL);
return -EPROTO; return -EPROTO;
} }
...@@ -436,7 +436,7 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp) ...@@ -436,7 +436,7 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp)
if (!serial) if (!serial)
return; return;
dbg (__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (serial->dev) { if (serial->dev) {
if (port->tty) { if (port->tty) {
...@@ -451,23 +451,23 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp) ...@@ -451,23 +451,23 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp)
} }
/* shutdown our urbs */ /* shutdown our urbs */
dbg (__FUNCTION__ " - shutting down urbs"); dbg("%s - shutting down urbs", __FUNCTION__);
result = usb_unlink_urb (port->write_urb); result = usb_unlink_urb (port->write_urb);
if (result) if (result)
dbg (__FUNCTION__ " - usb_unlink_urb " dbg("%s - usb_unlink_urb (write_urb)"
"(write_urb) failed with reason: %d", " failed with reason: %d", __FUNCTION__,
result); result);
result = usb_unlink_urb (port->read_urb); result = usb_unlink_urb (port->read_urb);
if (result) if (result)
dbg (__FUNCTION__ " - usb_unlink_urb " dbg("%s - usb_unlink_urb (read_urb) "
"(read_urb) failed with reason: %d", "failed with reason: %d", __FUNCTION__,
result); result);
result = usb_unlink_urb (port->interrupt_in_urb); result = usb_unlink_urb (port->interrupt_in_urb);
if (result) if (result)
dbg (__FUNCTION__ " - usb_unlink_urb " dbg("%s - usb_unlink_urb (interrupt_in_urb)"
"(interrupt_in_urb) failed with reason: %d", " failed with reason: %d", __FUNCTION__,
result); result);
} }
} }
...@@ -516,7 +516,7 @@ static int get_modem_info (struct usb_serial_port *port, unsigned int *value) ...@@ -516,7 +516,7 @@ static int get_modem_info (struct usb_serial_port *port, unsigned int *value)
result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0) result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0)
| ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0); | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0);
dbg (__FUNCTION__ " - result = %x", result); dbg("%s - result = %x", __FUNCTION__, result);
if (copy_to_user(value, &result, sizeof(int))) if (copy_to_user(value, &result, sizeof(int)))
return -EFAULT; return -EFAULT;
...@@ -525,22 +525,22 @@ static int get_modem_info (struct usb_serial_port *port, unsigned int *value) ...@@ -525,22 +525,22 @@ static int get_modem_info (struct usb_serial_port *port, unsigned int *value)
static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg)
{ {
dbg (__FUNCTION__" (%d) cmd = 0x%04x", port->number, cmd); dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd);
switch (cmd) { switch (cmd) {
case TIOCMGET: case TIOCMGET:
dbg (__FUNCTION__" (%d) TIOCMGET", port->number); dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number);
return get_modem_info (port, (unsigned int *)arg); return get_modem_info (port, (unsigned int *)arg);
case TIOCMBIS: case TIOCMBIS:
case TIOCMBIC: case TIOCMBIC:
case TIOCMSET: case TIOCMSET:
dbg(__FUNCTION__" (%d) TIOCMSET/TIOCMBIC/TIOCMSET", port->number); dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number);
return set_modem_info(port, cmd, (unsigned int *) arg); return set_modem_info(port, cmd, (unsigned int *) arg);
default: default:
dbg (__FUNCTION__" not supported = 0x%04x", cmd); dbg("%s not supported = 0x%04x", __FUNCTION__, cmd);
break; break;
} }
...@@ -554,19 +554,19 @@ static void pl2303_break_ctl (struct usb_serial_port *port, int break_state) ...@@ -554,19 +554,19 @@ static void pl2303_break_ctl (struct usb_serial_port *port, int break_state)
u16 state; u16 state;
int result; int result;
dbg (__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (break_state == 0) if (break_state == 0)
state = BREAK_OFF; state = BREAK_OFF;
else else
state = BREAK_ON; state = BREAK_ON;
dbg (__FUNCTION__" - turning break %s", state==BREAK_OFF ? "off" : "on"); dbg("%s - turning break %s", state==BREAK_OFF ? "off" : "on", __FUNCTION__);
result = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0), result = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0),
BREAK_REQUEST, BREAK_REQUEST_TYPE, state, BREAK_REQUEST, BREAK_REQUEST_TYPE, state,
0, NULL, 0, 100); 0, NULL, 0, 100);
if (result) if (result)
dbg (__FUNCTION__" - error sending break = %d", result); dbg("%s - error sending break = %d", __FUNCTION__, result);
} }
...@@ -574,7 +574,7 @@ static void pl2303_shutdown (struct usb_serial *serial) ...@@ -574,7 +574,7 @@ static void pl2303_shutdown (struct usb_serial *serial)
{ {
int i; int i;
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
for (i = 0; i < serial->num_ports; ++i) for (i = 0; i < serial->num_ports; ++i)
kfree (serial->port[i].private); kfree (serial->port[i].private);
...@@ -620,30 +620,30 @@ static void pl2303_read_bulk_callback (struct urb *urb) ...@@ -620,30 +620,30 @@ static void pl2303_read_bulk_callback (struct urb *urb)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg (__FUNCTION__ " - urb->status = %d", urb->status); dbg("%s - urb->status = %d", __FUNCTION__, urb->status);
if (!port->open_count) { if (!port->open_count) {
dbg (__FUNCTION__ " - port is closed, exiting."); dbg("%s - port is closed, exiting.", __FUNCTION__);
return; return;
} }
if (urb->status == -EPROTO) { if (urb->status == -EPROTO) {
/* PL2303 mysteriously fails with -EPROTO reschedule the read */ /* PL2303 mysteriously fails with -EPROTO reschedule the read */
dbg (__FUNCTION__ " - caught -EPROTO, resubmitting the urb"); dbg("%s - caught -EPROTO, resubmitting the urb", __FUNCTION__);
urb->status = 0; urb->status = 0;
urb->dev = serial->dev; urb->dev = serial->dev;
result = usb_submit_urb(urb, GFP_ATOMIC); result = usb_submit_urb(urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
return; return;
} }
dbg (__FUNCTION__ " - unable to handle the error, exiting."); dbg("%s - unable to handle the error, exiting.", __FUNCTION__);
return; return;
} }
...@@ -665,7 +665,7 @@ static void pl2303_read_bulk_callback (struct urb *urb) ...@@ -665,7 +665,7 @@ static void pl2303_read_bulk_callback (struct urb *urb)
urb->dev = serial->dev; urb->dev = serial->dev;
result = usb_submit_urb(urb, GFP_ATOMIC); result = usb_submit_urb(urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
} }
return; return;
...@@ -681,20 +681,20 @@ static void pl2303_write_bulk_callback (struct urb *urb) ...@@ -681,20 +681,20 @@ static void pl2303_write_bulk_callback (struct urb *urb)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return; return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (urb->status) { if (urb->status) {
/* error in the urb, so we have to resubmit it */ /* error in the urb, so we have to resubmit it */
if (serial_paranoia_check (port->serial, __FUNCTION__)) { if (serial_paranoia_check (port->serial, __FUNCTION__)) {
return; return;
} }
dbg (__FUNCTION__ " - Overflow in write"); dbg("%s - Overflow in write", __FUNCTION__);
dbg (__FUNCTION__ " - nonzero write bulk status received: %d", urb->status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
port->write_urb->transfer_buffer_length = 1; port->write_urb->transfer_buffer_length = 1;
port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev;
result = usb_submit_urb (port->write_urb, GFP_ATOMIC); result = usb_submit_urb (port->write_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting write urb, error %d", result); err("%s - failed resubmitting write urb, error %d", __FUNCTION__, result);
return; return;
} }
......
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