aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-02-10 07:20:51 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-10 13:21:04 -0500
commit22a416c4e0f2179b57028e084ac0ed2c110333bd (patch)
treeb885af923a343b1e7eb45ff3bd33e3c8a4526334 /drivers/usb/serial
parentf1475a00a11b07e6ac7f97971466c1bfbf491957 (diff)
USB: serial: use dev_err_console in custom write paths
Use dev_err_console in write paths for devices which can be used as a console but do not use the generic write implementation. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/cypress_m8.c2
-rw-r--r--drivers/usb/serial/digi_acceleport.c4
-rw-r--r--drivers/usb/serial/io_edgeport.c4
-rw-r--r--drivers/usb/serial/io_ti.c4
-rw-r--r--drivers/usb/serial/mos7720.c4
-rw-r--r--drivers/usb/serial/mos7840.c4
-rw-r--r--drivers/usb/serial/omninet.c2
-rw-r--r--drivers/usb/serial/oti6858.c6
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c5
-rw-r--r--drivers/usb/serial/whiteheat.c2
10 files changed, 18 insertions, 19 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index 3bdeafa29c24..5ae86b349cad 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -800,7 +800,7 @@ send:
800 cypress_write_int_callback, port, priv->write_urb_interval); 800 cypress_write_int_callback, port, priv->write_urb_interval);
801 result = usb_submit_urb(port->interrupt_out_urb, GFP_ATOMIC); 801 result = usb_submit_urb(port->interrupt_out_urb, GFP_ATOMIC);
802 if (result) { 802 if (result) {
803 dev_err(&port->dev, 803 dev_err_console(port,
804 "%s - failed submitting write urb, error %d\n", 804 "%s - failed submitting write urb, error %d\n",
805 __func__, result); 805 __func__, result);
806 priv->write_urb_in_use = 0; 806 priv->write_urb_in_use = 0;
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index b23bebd721a1..2b1da0cc071a 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -995,7 +995,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
995 /* return length of new data written, or error */ 995 /* return length of new data written, or error */
996 spin_unlock_irqrestore(&priv->dp_port_lock, flags); 996 spin_unlock_irqrestore(&priv->dp_port_lock, flags);
997 if (ret < 0) 997 if (ret < 0)
998 dev_err(&port->dev, 998 dev_err_console(port,
999 "%s: usb_submit_urb failed, ret=%d, port=%d\n", 999 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
1000 __func__, ret, priv->dp_port_num); 1000 __func__, ret, priv->dp_port_num);
1001 dbg("digi_write: returning %d", ret); 1001 dbg("digi_write: returning %d", ret);
@@ -1065,7 +1065,7 @@ static void digi_write_bulk_callback(struct urb *urb)
1065 1065
1066 spin_unlock(&priv->dp_port_lock); 1066 spin_unlock(&priv->dp_port_lock);
1067 if (ret && ret != -EPERM) 1067 if (ret && ret != -EPERM)
1068 dev_err(&port->dev, 1068 dev_err_console(port,
1069 "%s: usb_submit_urb failed, ret=%d, port=%d\n", 1069 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
1070 __func__, ret, priv->dp_port_num); 1070 __func__, ret, priv->dp_port_num);
1071} 1071}
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 0497575e4799..616b07862771 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -1286,7 +1286,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial,
1286 count = fifo->count; 1286 count = fifo->count;
1287 buffer = kmalloc(count+2, GFP_ATOMIC); 1287 buffer = kmalloc(count+2, GFP_ATOMIC);
1288 if (buffer == NULL) { 1288 if (buffer == NULL) {
1289 dev_err(&edge_port->port->dev, 1289 dev_err_console(edge_port->port,
1290 "%s - no more kernel memory...\n", __func__); 1290 "%s - no more kernel memory...\n", __func__);
1291 edge_port->write_in_progress = false; 1291 edge_port->write_in_progress = false;
1292 goto exit_send; 1292 goto exit_send;
@@ -1331,7 +1331,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial,
1331 status = usb_submit_urb(urb, GFP_ATOMIC); 1331 status = usb_submit_urb(urb, GFP_ATOMIC);
1332 if (status) { 1332 if (status) {
1333 /* something went wrong */ 1333 /* something went wrong */
1334 dev_err(&edge_port->port->dev, 1334 dev_err_console(edge_port->port,
1335 "%s - usb_submit_urb(write bulk) failed, status = %d, data lost\n", 1335 "%s - usb_submit_urb(write bulk) failed, status = %d, data lost\n",
1336 __func__, status); 1336 __func__, status);
1337 edge_port->write_in_progress = false; 1337 edge_port->write_in_progress = false;
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 65bf06aa591a..311e4bf46dee 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -1817,7 +1817,7 @@ static void edge_bulk_out_callback(struct urb *urb)
1817 __func__, status); 1817 __func__, status);
1818 return; 1818 return;
1819 default: 1819 default:
1820 dev_err(&urb->dev->dev, "%s - nonzero write bulk status " 1820 dev_err_console(port, "%s - nonzero write bulk status "
1821 "received: %d\n", __func__, status); 1821 "received: %d\n", __func__, status);
1822 } 1822 }
1823 1823
@@ -2111,7 +2111,7 @@ static void edge_send(struct tty_struct *tty)
2111 /* send the data out the bulk port */ 2111 /* send the data out the bulk port */
2112 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); 2112 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
2113 if (result) { 2113 if (result) {
2114 dev_err(&port->dev, 2114 dev_err_console(port,
2115 "%s - failed submitting write urb, error %d\n", 2115 "%s - failed submitting write urb, error %d\n",
2116 __func__, result); 2116 __func__, result);
2117 edge_port->ep_write_urb_in_use = 0; 2117 edge_port->ep_write_urb_in_use = 0;
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 4554ee49e635..4fb29b4aaad6 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1294,7 +1294,7 @@ static int mos7720_write(struct tty_struct *tty, struct usb_serial_port *port,
1294 urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE, 1294 urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
1295 GFP_KERNEL); 1295 GFP_KERNEL);
1296 if (urb->transfer_buffer == NULL) { 1296 if (urb->transfer_buffer == NULL) {
1297 dev_err(&port->dev, "%s no more kernel memory...\n", 1297 dev_err_console(port, "%s no more kernel memory...\n",
1298 __func__); 1298 __func__);
1299 goto exit; 1299 goto exit;
1300 } 1300 }
@@ -1315,7 +1315,7 @@ static int mos7720_write(struct tty_struct *tty, struct usb_serial_port *port,
1315 /* send it down the pipe */ 1315 /* send it down the pipe */
1316 status = usb_submit_urb(urb, GFP_ATOMIC); 1316 status = usb_submit_urb(urb, GFP_ATOMIC);
1317 if (status) { 1317 if (status) {
1318 dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed " 1318 dev_err_console(port, "%s - usb_submit_urb(write bulk) failed "
1319 "with status = %d\n", __func__, status); 1319 "with status = %d\n", __func__, status);
1320 bytes_sent = status; 1320 bytes_sent = status;
1321 goto exit; 1321 goto exit;
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 03b5e249e95e..19b11cece6ba 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1509,7 +1509,7 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port,
1509 kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL); 1509 kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
1510 1510
1511 if (urb->transfer_buffer == NULL) { 1511 if (urb->transfer_buffer == NULL) {
1512 dev_err(&port->dev, "%s no more kernel memory...\n", 1512 dev_err_console(port, "%s no more kernel memory...\n",
1513 __func__); 1513 __func__);
1514 goto exit; 1514 goto exit;
1515 } 1515 }
@@ -1535,7 +1535,7 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port,
1535 1535
1536 if (status) { 1536 if (status) {
1537 mos7840_port->busy[i] = 0; 1537 mos7840_port->busy[i] = 0;
1538 dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed " 1538 dev_err_console(port, "%s - usb_submit_urb(write bulk) failed "
1539 "with status = %d\n", __func__, status); 1539 "with status = %d\n", __func__, status);
1540 bytes_sent = status; 1540 bytes_sent = status;
1541 goto exit; 1541 goto exit;
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 8b8d58a2ac12..033e8afa6c77 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -254,7 +254,7 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
254 result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); 254 result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
255 if (result) { 255 if (result) {
256 set_bit(0, &wport->write_urbs_free); 256 set_bit(0, &wport->write_urbs_free);
257 dev_err(&port->dev, 257 dev_err_console(port,
258 "%s - failed submitting write urb, error %d\n", 258 "%s - failed submitting write urb, error %d\n",
259 __func__, result); 259 __func__, result);
260 } else 260 } else
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index e287fd32682c..343e626a06f8 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -302,7 +302,7 @@ static void send_data(struct work_struct *work)
302 if (count != 0) { 302 if (count != 0) {
303 allow = kmalloc(1, GFP_KERNEL); 303 allow = kmalloc(1, GFP_KERNEL);
304 if (!allow) { 304 if (!allow) {
305 dev_err(&port->dev, "%s(): kmalloc failed\n", 305 dev_err_console(port, "%s(): kmalloc failed\n",
306 __func__); 306 __func__);
307 return; 307 return;
308 } 308 }
@@ -334,7 +334,7 @@ static void send_data(struct work_struct *work)
334 port->write_urb->transfer_buffer_length = count; 334 port->write_urb->transfer_buffer_length = count;
335 result = usb_submit_urb(port->write_urb, GFP_NOIO); 335 result = usb_submit_urb(port->write_urb, GFP_NOIO);
336 if (result != 0) { 336 if (result != 0) {
337 dev_err(&port->dev, "%s(): usb_submit_urb() failed" 337 dev_err_console(port, "%s(): usb_submit_urb() failed"
338 " with error %d\n", __func__, result); 338 " with error %d\n", __func__, result);
339 priv->flags.write_urb_in_use = 0; 339 priv->flags.write_urb_in_use = 0;
340 } 340 }
@@ -938,7 +938,7 @@ static void oti6858_write_bulk_callback(struct urb *urb)
938 port->write_urb->transfer_buffer_length = 1; 938 port->write_urb->transfer_buffer_length = 1;
939 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); 939 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
940 if (result) { 940 if (result) {
941 dev_err(&port->dev, "%s(): usb_submit_urb() failed," 941 dev_err_console(port, "%s(): usb_submit_urb() failed,"
942 " error %d\n", __func__, result); 942 " error %d\n", __func__, result);
943 } else { 943 } else {
944 return; 944 return;
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 8468eb769a29..91d0dc640360 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1248,7 +1248,6 @@ static void ti_bulk_out_callback(struct urb *urb)
1248{ 1248{
1249 struct ti_port *tport = urb->context; 1249 struct ti_port *tport = urb->context;
1250 struct usb_serial_port *port = tport->tp_port; 1250 struct usb_serial_port *port = tport->tp_port;
1251 struct device *dev = &urb->dev->dev;
1252 int status = urb->status; 1251 int status = urb->status;
1253 1252
1254 dbg("%s - port %d", __func__, port->number); 1253 dbg("%s - port %d", __func__, port->number);
@@ -1266,7 +1265,7 @@ static void ti_bulk_out_callback(struct urb *urb)
1266 wake_up_interruptible(&tport->tp_write_wait); 1265 wake_up_interruptible(&tport->tp_write_wait);
1267 return; 1266 return;
1268 default: 1267 default:
1269 dev_err(dev, "%s - nonzero urb status, %d\n", 1268 dev_err_console(port, "%s - nonzero urb status, %d\n",
1270 __func__, status); 1269 __func__, status);
1271 tport->tp_tdev->td_urb_error = 1; 1270 tport->tp_tdev->td_urb_error = 1;
1272 wake_up_interruptible(&tport->tp_write_wait); 1271 wake_up_interruptible(&tport->tp_write_wait);
@@ -1335,7 +1334,7 @@ static void ti_send(struct ti_port *tport)
1335 1334
1336 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); 1335 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
1337 if (result) { 1336 if (result) {
1338 dev_err(&port->dev, "%s - submit write urb failed, %d\n", 1337 dev_err_console(port, "%s - submit write urb failed, %d\n",
1339 __func__, result); 1338 __func__, result);
1340 tport->tp_write_urb_in_use = 0; 1339 tport->tp_write_urb_in_use = 0;
1341 /* TODO: reschedule ti_send */ 1340 /* TODO: reschedule ti_send */
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 7e0acf5c8e38..007cf3a2481a 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -740,7 +740,7 @@ static int whiteheat_write(struct tty_struct *tty,
740 urb->transfer_buffer_length = bytes; 740 urb->transfer_buffer_length = bytes;
741 result = usb_submit_urb(urb, GFP_ATOMIC); 741 result = usb_submit_urb(urb, GFP_ATOMIC);
742 if (result) { 742 if (result) {
743 dev_err(&port->dev, 743 dev_err_console(port,
744 "%s - failed submitting write urb, error %d\n", 744 "%s - failed submitting write urb, error %d\n",
745 __func__, result); 745 __func__, result);
746 sent = result; 746 sent = result;