aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2016-05-08 14:08:00 -0400
committerJohan Hovold <johan@kernel.org>2016-05-10 03:39:57 -0400
commit0cd782b0bea1917a522efaedf79429fd7f6621b9 (patch)
tree5100d07acd673254a88132b22980bc73f2ec3546
parent61924505ae0037527879446b36ac27c60210bc77 (diff)
USB: serial: keyspan: fix debug and error messages
The URB status is signed and should be printed using %d rather than %x. Also print endpoint addresses consistently using %x rather than %d, and merge a broken-up error message string. Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/serial/keyspan.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 86d54932843d..1f9414bdd649 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -255,7 +255,7 @@ static int keyspan_write(struct tty_struct *tty,
255 return count; 255 return count;
256 } 256 }
257 257
258 dev_dbg(&port->dev, "%s - endpoint %d flip %d\n", 258 dev_dbg(&port->dev, "%s - endpoint %x flip %d\n",
259 __func__, usb_pipeendpoint(this_urb->pipe), flip); 259 __func__, usb_pipeendpoint(this_urb->pipe), flip);
260 260
261 if (this_urb->status == -EINPROGRESS) { 261 if (this_urb->status == -EINPROGRESS) {
@@ -300,7 +300,7 @@ static void usa26_indat_callback(struct urb *urb)
300 endpoint = usb_pipeendpoint(urb->pipe); 300 endpoint = usb_pipeendpoint(urb->pipe);
301 301
302 if (status) { 302 if (status) {
303 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x on endpoint %d.\n", 303 dev_dbg(&urb->dev->dev, "%s - nonzero status %d on endpoint %x\n",
304 __func__, status, endpoint); 304 __func__, status, endpoint);
305 return; 305 return;
306 } 306 }
@@ -393,7 +393,8 @@ static void usa26_instat_callback(struct urb *urb)
393 serial = urb->context; 393 serial = urb->context;
394 394
395 if (status) { 395 if (status) {
396 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x\n", __func__, status); 396 dev_dbg(&urb->dev->dev, "%s - nonzero status: %d\n",
397 __func__, status);
397 return; 398 return;
398 } 399 }
399 if (urb->actual_length != 9) { 400 if (urb->actual_length != 9) {
@@ -452,7 +453,7 @@ static void usa28_indat_callback(struct urb *urb)
452 453
453 do { 454 do {
454 if (status) { 455 if (status) {
455 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x on endpoint %d.\n", 456 dev_dbg(&urb->dev->dev, "%s - nonzero status %d on endpoint %x\n",
456 __func__, status, usb_pipeendpoint(urb->pipe)); 457 __func__, status, usb_pipeendpoint(urb->pipe));
457 return; 458 return;
458 } 459 }
@@ -511,7 +512,8 @@ static void usa28_instat_callback(struct urb *urb)
511 serial = urb->context; 512 serial = urb->context;
512 513
513 if (status) { 514 if (status) {
514 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x\n", __func__, status); 515 dev_dbg(&urb->dev->dev, "%s - nonzero status: %d\n",
516 __func__, status);
515 return; 517 return;
516 } 518 }
517 519
@@ -591,7 +593,8 @@ static void usa49_instat_callback(struct urb *urb)
591 serial = urb->context; 593 serial = urb->context;
592 594
593 if (status) { 595 if (status) {
594 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x\n", __func__, status); 596 dev_dbg(&urb->dev->dev, "%s - nonzero status: %d\n",
597 __func__, status);
595 return; 598 return;
596 } 599 }
597 600
@@ -646,7 +649,7 @@ static void usa49_indat_callback(struct urb *urb)
646 endpoint = usb_pipeendpoint(urb->pipe); 649 endpoint = usb_pipeendpoint(urb->pipe);
647 650
648 if (status) { 651 if (status) {
649 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x on endpoint %d.\n", 652 dev_dbg(&urb->dev->dev, "%s - nonzero status %d on endpoint %x\n",
650 __func__, status, endpoint); 653 __func__, status, endpoint);
651 return; 654 return;
652 } 655 }
@@ -698,7 +701,8 @@ static void usa49wg_indat_callback(struct urb *urb)
698 serial = urb->context; 701 serial = urb->context;
699 702
700 if (status) { 703 if (status) {
701 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x\n", __func__, status); 704 dev_dbg(&urb->dev->dev, "%s - nonzero status: %d\n",
705 __func__, status);
702 return; 706 return;
703 } 707 }
704 708
@@ -774,8 +778,8 @@ static void usa90_indat_callback(struct urb *urb)
774 endpoint = usb_pipeendpoint(urb->pipe); 778 endpoint = usb_pipeendpoint(urb->pipe);
775 779
776 if (status) { 780 if (status) {
777 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x on endpoint %d.\n", 781 dev_dbg(&urb->dev->dev, "%s - nonzero status %d on endpoint %x\n",
778 __func__, status, endpoint); 782 __func__, status, endpoint);
779 return; 783 return;
780 } 784 }
781 785
@@ -847,7 +851,8 @@ static void usa90_instat_callback(struct urb *urb)
847 serial = urb->context; 851 serial = urb->context;
848 852
849 if (status) { 853 if (status) {
850 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x\n", __func__, status); 854 dev_dbg(&urb->dev->dev, "%s - nonzero status: %d\n",
855 __func__, status);
851 return; 856 return;
852 } 857 }
853 if (urb->actual_length < 14) { 858 if (urb->actual_length < 14) {
@@ -912,7 +917,8 @@ static void usa67_instat_callback(struct urb *urb)
912 serial = urb->context; 917 serial = urb->context;
913 918
914 if (status) { 919 if (status) {
915 dev_dbg(&urb->dev->dev, "%s - nonzero status: %x\n", __func__, status); 920 dev_dbg(&urb->dev->dev, "%s - nonzero status: %d\n",
921 __func__, status);
916 return; 922 return;
917 } 923 }
918 924
@@ -1215,8 +1221,8 @@ static struct usb_endpoint_descriptor const *find_ep(struct usb_serial const *se
1215 if (ep->bEndpointAddress == endpoint) 1221 if (ep->bEndpointAddress == endpoint)
1216 return ep; 1222 return ep;
1217 } 1223 }
1218 dev_warn(&serial->interface->dev, "found no endpoint descriptor for " 1224 dev_warn(&serial->interface->dev, "found no endpoint descriptor for endpoint %x\n",
1219 "endpoint %x\n", endpoint); 1225 endpoint);
1220 return NULL; 1226 return NULL;
1221} 1227}
1222 1228
@@ -1231,7 +1237,8 @@ static struct urb *keyspan_setup_urb(struct usb_serial *serial, int endpoint,
1231 if (endpoint == -1) 1237 if (endpoint == -1)
1232 return NULL; /* endpoint not needed */ 1238 return NULL; /* endpoint not needed */
1233 1239
1234 dev_dbg(&serial->interface->dev, "%s - alloc for endpoint %d.\n", __func__, endpoint); 1240 dev_dbg(&serial->interface->dev, "%s - alloc for endpoint %x\n",
1241 __func__, endpoint);
1235 urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ 1242 urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
1236 if (!urb) 1243 if (!urb)
1237 return NULL; 1244 return NULL;
@@ -1566,7 +1573,8 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial,
1566 return -1; 1573 return -1;
1567 } 1574 }
1568 1575
1569 dev_dbg(&port->dev, "%s - endpoint %d\n", __func__, usb_pipeendpoint(this_urb->pipe)); 1576 dev_dbg(&port->dev, "%s - endpoint %x\n",
1577 __func__, usb_pipeendpoint(this_urb->pipe));
1570 1578
1571 /* Save reset port val for resend. 1579 /* Save reset port val for resend.
1572 Don't overwrite resend for open/close condition. */ 1580 Don't overwrite resend for open/close condition. */
@@ -1832,7 +1840,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial,
1832 return -1; 1840 return -1;
1833 } 1841 }
1834 1842
1835 dev_dbg(&port->dev, "%s - endpoint %d (%d)\n", 1843 dev_dbg(&port->dev, "%s - endpoint %x (%d)\n",
1836 __func__, usb_pipeendpoint(this_urb->pipe), device_port); 1844 __func__, usb_pipeendpoint(this_urb->pipe), device_port);
1837 1845
1838 /* Save reset port val for resend. 1846 /* Save reset port val for resend.