int result = 0;
unsigned long flags = 0;
- dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+ dev_dbg(&port->dev, "%s\n", __func__);
switch (urb->status) {
case 0:
case -ENOENT:
case -ESHUTDOWN:
/* urb has been terminated. */
- dbg("METRO-USB - %s - urb shutting down, port number=%d, error code=%d",
- __FUNCTION__, port->number, result);
+ dev_dbg(&port->dev,
+ "%s - urb shutting down, error code=%d\n",
+ __func__, result);
return;
default:
- dbg("METRO-USB - %s - non-zero urb received, port number=%d, error code=%d",
- __FUNCTION__, port->number, result);
+ dev_dbg(&port->dev,
+ "%s - non-zero urb received, error code=%d\n",
+ __func__, result);
goto exit;
}
/* Set the data read from the usb port into the serial port buffer. */
tty = tty_port_tty_get(&port->port);
if (!tty) {
- dbg("%s - bad tty pointer - exiting", __func__);
+ dev_dbg(&port->dev, "%s - bad tty pointer - exiting\n",
+ __func__);
return;
}
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
- if (result) {
- dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d",
- __FUNCTION__, port->number, result);
- }
+ if (result)
+ dev_dbg(&port->dev,
+ "%s - failed submitting interrupt in urb, error code=%d\n",
+ __func__, result);
}
return;
exit:
/* Try to resubmit the urb. */
result = usb_submit_urb(urb, GFP_ATOMIC);
- if (result) {
- dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d",
- __FUNCTION__, port->number, result);
- }
+ if (result)
+ dev_dbg(&port->dev,
+ "%s - failed submitting interrupt in urb, error code=%d\n",
+ __func__, result);
}
static void metrousb_cleanup(struct usb_serial_port *port)
{
- dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+ dev_dbg(&port->dev, "%s\n", __func__);
if (port->serial->dev) {
/* Shutdown any interrupt in urbs. */
unsigned long flags = 0;
int result = 0;
- dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+ dev_dbg(&port->dev, "%s\n", __func__);
/* Make sure the urb is initialized. */
if (!port->interrupt_in_urb) {
- dbg("METRO-USB - %s - interrupt urb not initialized for port number=%d", __FUNCTION__, port->number);
+ dev_dbg(&port->dev, "%s - interrupt urb not initialized\n",
+ __func__);
return -ENODEV;
}
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result) {
- dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d"
- , __FUNCTION__, port->number, result);
+ dev_dbg(&port->dev,
+ "%s - failed submitting interrupt in urb, error code=%d\n",
+ __func__, result);
goto exit;
}
- dbg("METRO-USB - %s - port open for port number=%d", __FUNCTION__, port->number);
+ dev_dbg(&port->dev, "%s - port open\n", __func__);
exit:
return result;
}
int retval = 0;
unsigned char mcr = METROUSB_MCR_NONE;
- dbg("METRO-USB - %s - control state=%d", __FUNCTION__, control_state);
+ dev_dbg(&serial->dev->dev, "%s - control state = %d\n",
+ __func__, control_state);
/* Set the modem control value. */
if (control_state & TIOCM_DTR)
METROUSB_SET_REQUEST_TYPE, METROUSB_SET_MODEM_CTRL_REQUEST,
control_state, 0, NULL, 0, WDR_TIMEOUT);
if (retval < 0)
- dbg("METRO-USB - %s - set modem ctrl=0x%x failed, error code=%d", __FUNCTION__, mcr, retval);
+ dev_dbg(&serial->dev->dev,
+ "%s - set modem ctrl=0x%x failed, error code=%d\n",
+ __func__, mcr, retval);
return retval;
}
{
int i = 0;
- dbg("METRO-USB - %s", __FUNCTION__);
+ dev_dbg(&serial->dev->dev, "%s\n", __func__);
/* Stop reading and writing on all ports. */
for (i = 0; i < serial->num_ports; ++i) {
kfree(usb_get_serial_port_data(serial->port[i]));
usb_set_serial_port_data(serial->port[i], NULL);
- dbg("METRO-USB - %s - freed port number=%d", __FUNCTION__, serial->port[i]->number);
+ dev_dbg(&serial->dev->dev, "%s - freed port number=%d\n",
+ __func__, serial->port[i]->number);
}
}
struct usb_serial_port *port;
int i = 0;
- dbg("METRO-USB - %s", __FUNCTION__);
+ dev_dbg(&serial->dev->dev, "%s\n", __func__);
/* Loop through the serial ports setting up the private structures.
* Currently we only use one port. */
spin_lock_init(&metro_priv->lock);
usb_set_serial_port_data(port, metro_priv);
- dbg("METRO-USB - %s - port number=%d.", __FUNCTION__, port->number);
+ dev_dbg(&serial->dev->dev, "%s - port number=%d\n ",
+ __func__, port->number);
}
return 0;
struct metrousb_private *metro_priv = usb_get_serial_port_data(port);
unsigned long flags = 0;
- dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+ dev_dbg(tty->dev, "%s\n", __func__);
/* Set the private information for the port to stop reading data. */
spin_lock_irqsave(&metro_priv->lock, flags);
struct metrousb_private *metro_priv = usb_get_serial_port_data(port);
unsigned long flags = 0;
- dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+ dev_dbg(tty->dev, "%s\n", __func__);
spin_lock_irqsave(&metro_priv->lock, flags);
control_state = metro_priv->control_state;
unsigned long flags = 0;
unsigned long control_state = 0;
- dbg("METRO-USB - %s - port number=%d, set=%d, clear=%d", __FUNCTION__, port->number, set, clear);
+ dev_dbg(tty->dev, "%s - set=%d, clear=%d\n", __func__, set, clear);
spin_lock_irqsave(&metro_priv->lock, flags);
control_state = metro_priv->control_state;
unsigned long flags = 0;
int result = 0;
- dbg("METRO-USB - %s - port number=%d", __FUNCTION__, port->number);
+ dev_dbg(tty->dev, "%s\n", __func__);
/* Set the private information for the port to resume reading data. */
spin_lock_irqsave(&metro_priv->lock, flags);
/* Submit the urb to read from the port. */
port->interrupt_in_urb->dev = port->serial->dev;
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
- if (result) {
- dbg("METRO-USB - %s - failed submitting interrupt in urb for port number=%d, error code=%d",
- __FUNCTION__, port->number, result);
- }
+ if (result)
+ dev_dbg(tty->dev,
+ "failed submitting interrupt in urb error code=%d\n",
+ result);
}
static struct usb_driver metrousb_driver = {