Commit 2621cee1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: serial: iuu_phoenix.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: Rusty Russell <rusty@rustcorp.com.au>
CC: Johan Hovold <jhovold@gmail.com>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 061b2a22
...@@ -72,7 +72,6 @@ struct iuu_private { ...@@ -72,7 +72,6 @@ struct iuu_private {
u8 *writebuf; /* buffer for writing to device */ u8 *writebuf; /* buffer for writing to device */
int writelen; /* num of byte to write to device */ int writelen; /* num of byte to write to device */
u8 *buf; /* used for initialize speed */ u8 *buf; /* used for initialize speed */
u8 *dbgbuf; /* debug buffer */
u8 len; u8 len;
int vcc; /* vcc (either 3 or 5 V) */ int vcc; /* vcc (either 3 or 5 V) */
u32 baud; u32 baud;
...@@ -84,32 +83,31 @@ struct iuu_private { ...@@ -84,32 +83,31 @@ struct iuu_private {
static void iuu_free_buf(struct iuu_private *priv) static void iuu_free_buf(struct iuu_private *priv)
{ {
kfree(priv->buf); kfree(priv->buf);
kfree(priv->dbgbuf);
kfree(priv->writebuf); kfree(priv->writebuf);
} }
static int iuu_alloc_buf(struct iuu_private *priv) static int iuu_alloc_buf(struct usb_serial *serial, struct iuu_private *priv)
{ {
priv->buf = kzalloc(256, GFP_KERNEL); priv->buf = kzalloc(256, GFP_KERNEL);
priv->dbgbuf = kzalloc(256, GFP_KERNEL);
priv->writebuf = kzalloc(256, GFP_KERNEL); priv->writebuf = kzalloc(256, GFP_KERNEL);
if (!priv->buf || !priv->dbgbuf || !priv->writebuf) { if (!priv->buf || !priv->writebuf) {
iuu_free_buf(priv); iuu_free_buf(priv);
dbg("%s problem allocation buffer", __func__); dev_dbg(&serial->dev->dev, "%s problem allocation buffer\n", __func__);
return -ENOMEM; return -ENOMEM;
} }
dbg("%s - Privates buffers allocation success", __func__); dev_dbg(&serial->dev->dev, "%s - Privates buffers allocation success\n", __func__);
return 0; return 0;
} }
static int iuu_startup(struct usb_serial *serial) static int iuu_startup(struct usb_serial *serial)
{ {
struct iuu_private *priv; struct iuu_private *priv;
priv = kzalloc(sizeof(struct iuu_private), GFP_KERNEL); priv = kzalloc(sizeof(struct iuu_private), GFP_KERNEL);
dbg("%s- priv allocation success", __func__); dev_dbg(&serial->dev->dev, "%s- priv allocation success\n", __func__);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
if (iuu_alloc_buf(priv)) { if (iuu_alloc_buf(serial, priv)) {
kfree(priv); kfree(priv);
return -ENOMEM; return -ENOMEM;
} }
...@@ -130,13 +128,13 @@ static void iuu_release(struct usb_serial *serial) ...@@ -130,13 +128,13 @@ static void iuu_release(struct usb_serial *serial)
if (priv) { if (priv) {
iuu_free_buf(priv); iuu_free_buf(priv);
dbg("%s - I will free all", __func__); dev_dbg(&port->dev, "%s - I will free all\n", __func__);
usb_set_serial_port_data(port, NULL); usb_set_serial_port_data(port, NULL);
dbg("%s - priv is not anymore in port structure", __func__); dev_dbg(&port->dev, "%s - priv is not anymore in port structure\n", __func__);
kfree(priv); kfree(priv);
dbg("%s priv is now kfree", __func__); dev_dbg(&port->dev, "%s priv is now kfree\n", __func__);
} }
} }
...@@ -148,13 +146,13 @@ static int iuu_tiocmset(struct tty_struct *tty, ...@@ -148,13 +146,13 @@ static int iuu_tiocmset(struct tty_struct *tty,
unsigned long flags; unsigned long flags;
/* FIXME: locking on tiomstatus */ /* FIXME: locking on tiomstatus */
dbg("%s (%d) msg : SET = 0x%04x, CLEAR = 0x%04x ", __func__, dev_dbg(&port->dev, "%s msg : SET = 0x%04x, CLEAR = 0x%04x\n",
port->number, set, clear); __func__, set, clear);
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
if ((set & TIOCM_RTS) && !(priv->tiostatus == TIOCM_RTS)) { if ((set & TIOCM_RTS) && !(priv->tiostatus == TIOCM_RTS)) {
dbg("%s TIOCMSET RESET called !!!", __func__); dev_dbg(&port->dev, "%s TIOCMSET RESET called !!!\n", __func__);
priv->reset = 1; priv->reset = 1;
} }
if (set & TIOCM_RTS) if (set & TIOCM_RTS)
...@@ -190,7 +188,7 @@ static void iuu_rxcmd(struct urb *urb) ...@@ -190,7 +188,7 @@ static void iuu_rxcmd(struct urb *urb)
int status = urb->status; int status = urb->status;
if (status) { if (status) {
dbg("%s - status = %d", __func__, status); dev_dbg(&port->dev, "%s - status = %d\n", __func__, status);
/* error stop all */ /* error stop all */
return; return;
} }
...@@ -244,13 +242,13 @@ static void iuu_update_status_callback(struct urb *urb) ...@@ -244,13 +242,13 @@ static void iuu_update_status_callback(struct urb *urb)
int status = urb->status; int status = urb->status;
if (status) { if (status) {
dbg("%s - status = %d", __func__, status); dev_dbg(&port->dev, "%s - status = %d\n", __func__, status);
/* error stop all */ /* error stop all */
return; return;
} }
st = urb->transfer_buffer; st = urb->transfer_buffer;
dbg("%s - enter", __func__); dev_dbg(&port->dev, "%s - enter\n", __func__);
if (urb->actual_length == 1) { if (urb->actual_length == 1) {
switch (st[0]) { switch (st[0]) {
case 0x1: case 0x1:
...@@ -272,7 +270,7 @@ static void iuu_status_callback(struct urb *urb) ...@@ -272,7 +270,7 @@ static void iuu_status_callback(struct urb *urb)
int result; int result;
int status = urb->status; int status = urb->status;
dbg("%s - status = %d", __func__, status); dev_dbg(&port->dev, "%s - status = %d\n", __func__, status);
usb_fill_bulk_urb(port->read_urb, port->serial->dev, usb_fill_bulk_urb(port->read_urb, port->serial->dev,
usb_rcvbulkpipe(port->serial->dev, usb_rcvbulkpipe(port->serial->dev,
port->bulk_in_endpointAddress), port->bulk_in_endpointAddress),
...@@ -311,9 +309,9 @@ static int bulk_immediate(struct usb_serial_port *port, u8 *buf, u8 count) ...@@ -311,9 +309,9 @@ static int bulk_immediate(struct usb_serial_port *port, u8 *buf, u8 count)
count, &actual, HZ * 1); count, &actual, HZ * 1);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - error = %2x", __func__, status); dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status);
else else
dbg("%s - write OK !", __func__); dev_dbg(&port->dev, "%s - write OK !\n", __func__);
return status; return status;
} }
...@@ -331,9 +329,9 @@ static int read_immediate(struct usb_serial_port *port, u8 *buf, u8 count) ...@@ -331,9 +329,9 @@ static int read_immediate(struct usb_serial_port *port, u8 *buf, u8 count)
count, &actual, HZ * 1); count, &actual, HZ * 1);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - error = %2x", __func__, status); dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status);
else else
dbg("%s - read OK !", __func__); dev_dbg(&port->dev, "%s - read OK !\n", __func__);
return status; return status;
} }
...@@ -357,9 +355,9 @@ static int iuu_led(struct usb_serial_port *port, unsigned int R, ...@@ -357,9 +355,9 @@ static int iuu_led(struct usb_serial_port *port, unsigned int R,
status = bulk_immediate(port, buf, 8); status = bulk_immediate(port, buf, 8);
kfree(buf); kfree(buf);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - led error status = %2x", __func__, status); dev_dbg(&port->dev, "%s - led error status = %2x\n", __func__, status);
else else
dbg("%s - led OK !", __func__); dev_dbg(&port->dev, "%s - led OK !\n", __func__);
return IUU_OPERATION_OK; return IUU_OPERATION_OK;
} }
...@@ -445,7 +443,7 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq) ...@@ -445,7 +443,7 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq)
status = bulk_immediate(port, (u8 *) priv->buf, Count); status = bulk_immediate(port, (u8 *) priv->buf, Count);
if (status != 0) { if (status != 0) {
dbg("%s - write error ", __func__); dev_dbg(&port->dev, "%s - write error\n", __func__);
return status; return status;
} }
} else if (frq == 3579000) { } else if (frq == 3579000) {
...@@ -554,12 +552,13 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq) ...@@ -554,12 +552,13 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq)
status = bulk_immediate(port, (u8 *) priv->buf, Count); status = bulk_immediate(port, (u8 *) priv->buf, Count);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - write error ", __func__); dev_dbg(&port->dev, "%s - write error\n", __func__);
return status; return status;
} }
static int iuu_uart_flush(struct usb_serial_port *port) static int iuu_uart_flush(struct usb_serial_port *port)
{ {
struct device *dev = &port->dev;
int i; int i;
int status; int status;
u8 rxcmd = IUU_UART_RX; u8 rxcmd = IUU_UART_RX;
...@@ -571,27 +570,26 @@ static int iuu_uart_flush(struct usb_serial_port *port) ...@@ -571,27 +570,26 @@ static int iuu_uart_flush(struct usb_serial_port *port)
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
status = bulk_immediate(port, &rxcmd, 1); status = bulk_immediate(port, &rxcmd, 1);
if (status != IUU_OPERATION_OK) { if (status != IUU_OPERATION_OK) {
dbg("%s - uart_flush_write error", __func__); dev_dbg(dev, "%s - uart_flush_write error\n", __func__);
return status; return status;
} }
status = read_immediate(port, &priv->len, 1); status = read_immediate(port, &priv->len, 1);
if (status != IUU_OPERATION_OK) { if (status != IUU_OPERATION_OK) {
dbg("%s - uart_flush_read error", __func__); dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
return status; return status;
} }
if (priv->len > 0) { if (priv->len > 0) {
dbg("%s - uart_flush datalen is : %i ", __func__, dev_dbg(dev, "%s - uart_flush datalen is : %i\n", __func__, priv->len);
priv->len);
status = read_immediate(port, priv->buf, priv->len); status = read_immediate(port, priv->buf, priv->len);
if (status != IUU_OPERATION_OK) { if (status != IUU_OPERATION_OK) {
dbg("%s - uart_flush_read error", __func__); dev_dbg(dev, "%s - uart_flush_read error\n", __func__);
return status; return status;
} }
} }
} }
dbg("%s - uart_flush_read OK!", __func__); dev_dbg(dev, "%s - uart_flush_read OK!\n", __func__);
iuu_led(port, 0, 0xF000, 0, 0xFF); iuu_led(port, 0, 0xF000, 0, 0xFF);
return status; return status;
} }
...@@ -610,10 +608,10 @@ static void read_buf_callback(struct urb *urb) ...@@ -610,10 +608,10 @@ static void read_buf_callback(struct urb *urb)
return; return;
} }
dbg("%s - %i chars to write", __func__, urb->actual_length); dev_dbg(&port->dev, "%s - %i chars to write\n", __func__, urb->actual_length);
tty = tty_port_tty_get(&port->port); tty = tty_port_tty_get(&port->port);
if (data == NULL) if (data == NULL)
dbg("%s - data is NULL !!!", __func__); dev_dbg(&port->dev, "%s - data is NULL !!!\n", __func__);
if (tty && urb->actual_length && data) { if (tty && urb->actual_length && data) {
tty_insert_flip_string(tty, data, urb->actual_length); tty_insert_flip_string(tty, data, urb->actual_length);
tty_flip_buffer_push(tty); tty_flip_buffer_push(tty);
...@@ -627,7 +625,6 @@ static int iuu_bulk_write(struct usb_serial_port *port) ...@@ -627,7 +625,6 @@ static int iuu_bulk_write(struct usb_serial_port *port)
struct iuu_private *priv = usb_get_serial_port_data(port); struct iuu_private *priv = usb_get_serial_port_data(port);
unsigned long flags; unsigned long flags;
int result; int result;
int i;
int buf_len; int buf_len;
char *buf_ptr = port->write_urb->transfer_buffer; char *buf_ptr = port->write_urb->transfer_buffer;
...@@ -640,14 +637,8 @@ static int iuu_bulk_write(struct usb_serial_port *port) ...@@ -640,14 +637,8 @@ static int iuu_bulk_write(struct usb_serial_port *port)
buf_len = priv->writelen; buf_len = priv->writelen;
priv->writelen = 0; priv->writelen = 0;
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
if (debug == 1) { dev_dbg(&port->dev, "%s - writing %i chars : %*ph\n", __func__,
for (i = 0; i < buf_len; i++) buf_len, buf_len, buf_ptr);
sprintf(priv->dbgbuf + i*2 ,
"%02X", priv->writebuf[i]);
priv->dbgbuf[buf_len+i*2] = 0;
dbg("%s - writing %i chars : %s", __func__,
buf_len, priv->dbgbuf);
}
usb_fill_bulk_urb(port->write_urb, port->serial->dev, usb_fill_bulk_urb(port->write_urb, port->serial->dev,
usb_sndbulkpipe(port->serial->dev, usb_sndbulkpipe(port->serial->dev,
port->bulk_out_endpointAddress), port->bulk_out_endpointAddress),
...@@ -683,18 +674,18 @@ static void iuu_uart_read_callback(struct urb *urb) ...@@ -683,18 +674,18 @@ static void iuu_uart_read_callback(struct urb *urb)
priv->poll++; priv->poll++;
if (status) { if (status) {
dbg("%s - status = %d", __func__, status); dev_dbg(&port->dev, "%s - status = %d\n", __func__, status);
/* error stop all */ /* error stop all */
return; return;
} }
if (data == NULL) if (data == NULL)
dbg("%s - data is NULL !!!", __func__); dev_dbg(&port->dev, "%s - data is NULL !!!\n", __func__);
if (urb->actual_length == 1 && data != NULL) if (urb->actual_length == 1 && data != NULL)
len = (int) data[0]; len = (int) data[0];
if (urb->actual_length > 1) { if (urb->actual_length > 1) {
dbg("%s - urb->actual_length = %i", __func__, dev_dbg(&port->dev, "%s - urb->actual_length = %i\n", __func__,
urb->actual_length); urb->actual_length);
error = 1; error = 1;
return; return;
...@@ -702,7 +693,7 @@ static void iuu_uart_read_callback(struct urb *urb) ...@@ -702,7 +693,7 @@ static void iuu_uart_read_callback(struct urb *urb)
/* if len > 0 call readbuf */ /* if len > 0 call readbuf */
if (len > 0 && error == 0) { if (len > 0 && error == 0) {
dbg("%s - call read buf - len to read is %i ", dev_dbg(&port->dev, "%s - call read buf - len to read is %i\n",
__func__, len); __func__, len);
status = iuu_read_buf(port, len); status = iuu_read_buf(port, len);
return; return;
...@@ -729,7 +720,7 @@ static void iuu_uart_read_callback(struct urb *urb) ...@@ -729,7 +720,7 @@ static void iuu_uart_read_callback(struct urb *urb)
} }
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
/* if nothing to write call again rxcmd */ /* if nothing to write call again rxcmd */
dbg("%s - rxcmd recall", __func__); dev_dbg(&port->dev, "%s - rxcmd recall\n", __func__);
iuu_led_activity_off(urb); iuu_led_activity_off(urb);
} }
...@@ -769,7 +760,7 @@ static void read_rxcmd_callback(struct urb *urb) ...@@ -769,7 +760,7 @@ static void read_rxcmd_callback(struct urb *urb)
port->read_urb->transfer_buffer, 256, port->read_urb->transfer_buffer, 256,
iuu_uart_read_callback, port); iuu_uart_read_callback, port);
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
dbg("%s - submit result = %d", __func__, result); dev_dbg(&port->dev, "%s - submit result = %d\n", __func__, result);
} }
static int iuu_uart_on(struct usb_serial_port *port) static int iuu_uart_on(struct usb_serial_port *port)
...@@ -789,13 +780,13 @@ static int iuu_uart_on(struct usb_serial_port *port) ...@@ -789,13 +780,13 @@ static int iuu_uart_on(struct usb_serial_port *port)
status = bulk_immediate(port, buf, 4); status = bulk_immediate(port, buf, 4);
if (status != IUU_OPERATION_OK) { if (status != IUU_OPERATION_OK) {
dbg("%s - uart_on error", __func__); dev_dbg(&port->dev, "%s - uart_on error\n", __func__);
goto uart_enable_failed; goto uart_enable_failed;
} }
/* iuu_reset() the card after iuu_uart_on() */ /* iuu_reset() the card after iuu_uart_on() */
status = iuu_uart_flush(port); status = iuu_uart_flush(port);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - uart_flush error", __func__); dev_dbg(&port->dev, "%s - uart_flush error\n", __func__);
uart_enable_failed: uart_enable_failed:
kfree(buf); kfree(buf);
return status; return status;
...@@ -813,7 +804,7 @@ static int iuu_uart_off(struct usb_serial_port *port) ...@@ -813,7 +804,7 @@ static int iuu_uart_off(struct usb_serial_port *port)
status = bulk_immediate(port, buf, 1); status = bulk_immediate(port, buf, 1);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - uart_off error", __func__); dev_dbg(&port->dev, "%s - uart_off error\n", __func__);
kfree(buf); kfree(buf);
return status; return status;
...@@ -830,7 +821,7 @@ static int iuu_uart_baud(struct usb_serial_port *port, u32 baud_base, ...@@ -830,7 +821,7 @@ static int iuu_uart_baud(struct usb_serial_port *port, u32 baud_base,
u8 T1reload = 0; u8 T1reload = 0;
unsigned int T1FrekvensHZ = 0; unsigned int T1FrekvensHZ = 0;
dbg("%s - enter baud_base=%d", __func__, baud_base); dev_dbg(&port->dev, "%s - enter baud_base=%d\n", __func__, baud_base);
dataout = kmalloc(sizeof(u8) * 5, GFP_KERNEL); dataout = kmalloc(sizeof(u8) * 5, GFP_KERNEL);
if (!dataout) if (!dataout)
...@@ -911,7 +902,7 @@ static int iuu_uart_baud(struct usb_serial_port *port, u32 baud_base, ...@@ -911,7 +902,7 @@ static int iuu_uart_baud(struct usb_serial_port *port, u32 baud_base,
status = bulk_immediate(port, dataout, DataCount); status = bulk_immediate(port, dataout, DataCount);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - uart_off error", __func__); dev_dbg(&port->dev, "%s - uart_off error\n", __func__);
kfree(dataout); kfree(dataout);
return status; return status;
} }
...@@ -932,7 +923,7 @@ static void iuu_set_termios(struct tty_struct *tty, ...@@ -932,7 +923,7 @@ static void iuu_set_termios(struct tty_struct *tty,
/* Just use the ospeed. ispeed should be the same. */ /* Just use the ospeed. ispeed should be the same. */
baud = tty->termios->c_ospeed; baud = tty->termios->c_ospeed;
dbg("%s - enter c_ospeed or baud=%d", __func__, baud); dev_dbg(&port->dev, "%s - enter c_ospeed or baud=%d\n", __func__, baud);
/* compute the parity parameter */ /* compute the parity parameter */
parity = 0; parity = 0;
...@@ -983,7 +974,7 @@ static void iuu_close(struct usb_serial_port *port) ...@@ -983,7 +974,7 @@ static void iuu_close(struct usb_serial_port *port)
if (serial->dev) { if (serial->dev) {
/* free writebuf */ /* free writebuf */
/* shutdown our urbs */ /* shutdown our urbs */
dbg("%s - shutting down urbs", __func__); dev_dbg(&port->dev, "%s - shutting down urbs\n", __func__);
usb_kill_urb(port->write_urb); usb_kill_urb(port->write_urb);
usb_kill_urb(port->read_urb); usb_kill_urb(port->read_urb);
usb_kill_urb(port->interrupt_in_urb); usb_kill_urb(port->interrupt_in_urb);
...@@ -1006,6 +997,7 @@ static void iuu_init_termios(struct tty_struct *tty) ...@@ -1006,6 +997,7 @@ static void iuu_init_termios(struct tty_struct *tty)
static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
{ {
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
struct device *dev = &port->dev;
u8 *buf; u8 *buf;
int result; int result;
int baud; int baud;
...@@ -1017,7 +1009,7 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -1017,7 +1009,7 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
/* Re-encode speed */ /* Re-encode speed */
tty_encode_baud_rate(tty, baud, baud); tty_encode_baud_rate(tty, baud, baud);
dbg("%s - port %d, baud %d", __func__, port->number, baud); dev_dbg(dev, "%s - baud %d\n", __func__, baud);
usb_clear_halt(serial->dev, port->write_urb->pipe); usb_clear_halt(serial->dev, port->write_urb->pipe);
usb_clear_halt(serial->dev, port->read_urb->pipe); usb_clear_halt(serial->dev, port->read_urb->pipe);
...@@ -1032,14 +1024,14 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -1032,14 +1024,14 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
result = usb_control_msg(port->serial->dev, \ result = usb_control_msg(port->serial->dev, \
usb_rcvctrlpipe(port->serial->dev, 0), \ usb_rcvctrlpipe(port->serial->dev, 0), \
b, a, c, d, buf, 1, 1000); \ b, a, c, d, buf, 1, 1000); \
dbg("0x%x:0x%x:0x%x:0x%x %d - %x", a, b, c, d, result, \ dev_dbg(dev, "0x%x:0x%x:0x%x:0x%x %d - %x\n", a, b, c, d, result, \
buf[0]); } while (0); buf[0]); } while (0);
#define SOUP(a, b, c, d) do { \ #define SOUP(a, b, c, d) do { \
result = usb_control_msg(port->serial->dev, \ result = usb_control_msg(port->serial->dev, \
usb_sndctrlpipe(port->serial->dev, 0), \ usb_sndctrlpipe(port->serial->dev, 0), \
b, a, c, d, NULL, 0, 1000); \ b, a, c, d, NULL, 0, 1000); \
dbg("0x%x:0x%x:0x%x:0x%x %d", a, b, c, d, result); } while (0) dev_dbg(dev, "0x%x:0x%x:0x%x:0x%x %d\n", a, b, c, d, result); } while (0)
/* This is not UART related but IUU USB driver related or something */ /* This is not UART related but IUU USB driver related or something */
/* like that. Basically no IUU will accept any commands from the USB */ /* like that. Basically no IUU will accept any commands from the USB */
...@@ -1119,7 +1111,7 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -1119,7 +1111,7 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
iuu_uart_flush(port); iuu_uart_flush(port);
dbg("%s - initialization done", __func__); dev_dbg(dev, "%s - initialization done\n", __func__);
memset(port->write_urb->transfer_buffer, IUU_UART_RX, 1); memset(port->write_urb->transfer_buffer, IUU_UART_RX, 1);
usb_fill_bulk_urb(port->write_urb, port->serial->dev, usb_fill_bulk_urb(port->write_urb, port->serial->dev,
...@@ -1129,11 +1121,10 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -1129,11 +1121,10 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
read_rxcmd_callback, port); read_rxcmd_callback, port);
result = usb_submit_urb(port->write_urb, GFP_KERNEL); result = usb_submit_urb(port->write_urb, GFP_KERNEL);
if (result) { if (result) {
dev_err(&port->dev, "%s - failed submitting read urb," dev_err(dev, "%s - failed submitting read urb, error %d\n", __func__, result);
" error %d\n", __func__, result);
iuu_close(port); iuu_close(port);
} else { } else {
dbg("%s - rxcmd OK", __func__); dev_dbg(dev, "%s - rxcmd OK\n", __func__);
} }
return result; return result;
...@@ -1159,9 +1150,9 @@ static int iuu_vcc_set(struct usb_serial_port *port, unsigned int vcc) ...@@ -1159,9 +1150,9 @@ static int iuu_vcc_set(struct usb_serial_port *port, unsigned int vcc)
kfree(buf); kfree(buf);
if (status != IUU_OPERATION_OK) if (status != IUU_OPERATION_OK)
dbg("%s - vcc error status = %2x", __func__, status); dev_dbg(&port->dev, "%s - vcc error status = %2x\n", __func__, status);
else else
dbg("%s - vcc OK !", __func__); dev_dbg(&port->dev, "%s - vcc OK !\n", __func__);
return status; return status;
} }
...@@ -1192,7 +1183,7 @@ static ssize_t store_vcc_mode(struct device *dev, ...@@ -1192,7 +1183,7 @@ static ssize_t store_vcc_mode(struct device *dev,
goto fail_store_vcc_mode; goto fail_store_vcc_mode;
} }
dbg("%s: setting vcc_mode = %ld", __func__, v); dev_dbg(dev, "%s: setting vcc_mode = %ld", __func__, v);
if ((v != 3) && (v != 5)) { if ((v != 3) && (v != 5)) {
dev_err(dev, "%s - vcc_mode %ld is invalid\n", __func__, v); dev_err(dev, "%s - vcc_mode %ld is invalid\n", __func__, v);
......
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