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

USB: cyberjack driver: fixed __FUNCTION__ usages.

parent c1556beb
......@@ -103,7 +103,7 @@ static int cyberjack_startup (struct usb_serial *serial)
{
struct cyberjack_private *priv;
dbg (__FUNCTION__);
dbg("%s", __FUNCTION__);
/* allocate the private data structure */
serial->port->private = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL);
......@@ -125,7 +125,7 @@ static void cyberjack_shutdown (struct usb_serial *serial)
{
int i;
dbg (__FUNCTION__);
dbg("%s", __FUNCTION__);
for (i=0; i < serial->num_ports; ++i) {
/* My special items, the standard routines free my urbs */
......@@ -142,7 +142,7 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
/* force low_latency on so that our tty_push actually forces
* the data through, otherwise it is scheduled, and with high
......@@ -164,14 +164,14 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result)
err(" usb_submit_urb(read int) failed");
dbg(__FUNCTION__ " - usb_submit_urb(int urb)");
dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
return result;
}
static void cyberjack_close (struct usb_serial_port *port, struct file *filp)
{
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (port->serial->dev) {
/* shutdown any bulk reads that might be going on */
......@@ -188,16 +188,16 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
int result;
int wrexpected;
dbg(__FUNCTION__ " - port %d", port->number);
dbg(__FUNCTION__ " - from_user %d", from_user);
dbg("%s - port %d", __FUNCTION__, port->number);
dbg("%s - from_user %d", __FUNCTION__, from_user);
if (count == 0) {
dbg(__FUNCTION__ " - write request of 0 bytes");
dbg("%s - write request of 0 bytes", __FUNCTION__);
return (0);
}
if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing");
dbg("%s - already writing", __FUNCTION__);
return (0);
}
......@@ -221,7 +221,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
if( priv->wrfilled >= 3 ) {
wrexpected = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
dbg(__FUNCTION__ " - expected data: %d", wrexpected);
dbg("%s - expected data: %d", __FUNCTION__, wrexpected);
} else {
wrexpected = sizeof(priv->wrbuf);
}
......@@ -230,7 +230,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* We have enough data to begin transmission */
int length;
dbg(__FUNCTION__ " - transmitting data (frame 1)");
dbg("%s - transmitting data (frame 1)", __FUNCTION__);
length = (wrexpected > port->bulk_out_size) ? port->bulk_out_size : wrexpected;
memcpy (port->write_urb->transfer_buffer, priv->wrbuf, length );
......@@ -248,18 +248,18 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result);
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
/* Throw away data. No better idea what to do with it. */
priv->wrfilled=0;
priv->wrsent=0;
return 0;
}
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled);
dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
if( priv->wrsent>=priv->wrfilled ) {
dbg(__FUNCTION__ " - buffer cleaned");
dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0;
priv->wrsent=0;
......@@ -278,7 +278,7 @@ static void cyberjack_read_int_callback( struct urb *urb )
if (port_paranoia_check (port, __FUNCTION__)) return;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
/* the urb might have been killed. */
if (urb->status)
......@@ -311,14 +311,14 @@ static void cyberjack_read_int_callback( struct urb *urb )
/* "+=" is probably more fault tollerant than "=" */
priv->rdtodo += size;
dbg(__FUNCTION__ " - rdtodo: %d", priv->rdtodo);
dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
if( !old_rdtodo ) {
port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if( result )
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)");
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
}
}
}
......@@ -333,16 +333,16 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
int i;
int result;
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
if (urb->status) {
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status);
dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return;
}
......@@ -366,15 +366,15 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
/* Just to be sure */
if( priv->rdtodo<0 ) priv->rdtodo=0;
dbg(__FUNCTION__ " - rdtodo: %d", priv->rdtodo);
dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
/* Continue to read if we have still urbs to do. */
if( priv->rdtodo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/ ) {
port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)");
err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
}
}
......@@ -384,15 +384,15 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
struct cyberjack_private *priv = (struct cyberjack_private *)port->private;
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
dbg(__FUNCTION__ " - port %d", port->number);
dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting");
dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return;
}
if (urb->status) {
dbg(__FUNCTION__ " - nonzero write bulk status received: %d", urb->status);
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
return;
}
......@@ -401,11 +401,11 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
int length, blksize, result;
if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing");
dbg("%s - already writing", __FUNCTION__);
return;
}
dbg(__FUNCTION__ " - transmitting data (frame n)");
dbg("%s - transmitting data (frame n)", __FUNCTION__);
length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ?
port->bulk_out_size : (priv->wrfilled - priv->wrsent);
......@@ -426,7 +426,7 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
/* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result);
err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
/* Throw away data. No better idea what to do with it. */
priv->wrfilled=0;
priv->wrsent=0;
......@@ -435,13 +435,13 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
return;
}
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled);
dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
if( (priv->wrsent>=priv->wrfilled) || (priv->wrsent>=blksize) ) {
dbg(__FUNCTION__ " - buffer cleaned");
dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0;
priv->wrsent=0;
......
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