Commit da73843f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Vojtech Pavlik

[PATCH] USB: convert pl2303 driver to use dev_err() and dev_info() macros

parent 77d062a5
...@@ -204,7 +204,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns ...@@ -204,7 +204,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("%s - failed submitting write urb, error %d", __FUNCTION__, result); dev_err(port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__, result);
else else
result = count; result = count;
...@@ -247,7 +247,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -247,7 +247,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
buf = kmalloc (7, GFP_KERNEL); buf = kmalloc (7, GFP_KERNEL);
if (!buf) { if (!buf) {
err("%s - out of memory.", __FUNCTION__); dev_err(port->dev, "%s - out of memory.\n", __FUNCTION__);
return; return;
} }
memset (buf, 0x00, 0x07); memset (buf, 0x00, 0x07);
...@@ -295,7 +295,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -295,7 +295,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
case B230400: baud = 230400; break; case B230400: baud = 230400; break;
case B460800: baud = 460800; break; case B460800: baud = 460800; break;
default: default:
err ("pl2303 driver does not support the baudrate requested (fix it)"); dev_err(port->dev, "pl2303 driver does not support the baudrate requested (fix it)\n");
break; break;
} }
dbg("%s - baud = %d", __FUNCTION__, baud); dbg("%s - baud = %d", __FUNCTION__, baud);
...@@ -413,7 +413,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -413,7 +413,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
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("%s - failed submitting read urb, error %d", __FUNCTION__, result); dev_err(port->dev, "%s - failed submitting read urb, error %d\n", __FUNCTION__, result);
pl2303_close (port, NULL); pl2303_close (port, NULL);
return -EPROTO; return -EPROTO;
} }
...@@ -422,7 +422,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -422,7 +422,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
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("%s - failed submitting interrupt urb, error %d", __FUNCTION__, result); dev_err(port->dev, "%s - failed submitting interrupt urb, error %d\n", __FUNCTION__, result);
pl2303_close (port, NULL); pl2303_close (port, NULL);
return -EPROTO; return -EPROTO;
} }
...@@ -621,8 +621,8 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -621,8 +621,8 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs)
exit: exit:
status = usb_submit_urb (urb, GFP_ATOMIC); status = usb_submit_urb (urb, GFP_ATOMIC);
if (status) if (status)
err ("%s - usb_submit_urb failed with result %d", dev_err(urb->dev->dev, "%s - usb_submit_urb failed with result %d\n",
__FUNCTION__, status); __FUNCTION__, status);
} }
...@@ -658,7 +658,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -658,7 +658,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
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("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); dev_err(urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
return; return;
} }
dbg("%s - unable to handle the error, exiting.", __FUNCTION__); dbg("%s - unable to handle the error, exiting.", __FUNCTION__);
...@@ -683,7 +683,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -683,7 +683,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
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("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); dev_err(urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
} }
return; return;
...@@ -712,7 +712,7 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -712,7 +712,7 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
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("%s - failed resubmitting write urb, error %d", __FUNCTION__, result); dev_err(urb->dev->dev, "%s - failed resubmitting write urb, error %d\n", __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