Commit 9908a32e94de2141463e104c9924279ed3509447
1 parent
194343d936
Exists in
master
and in
7 other branches
USB: remove err() macro from usb class drivers
USB should not be having it's own printk macros, so remove err() and use the system-wide standard of dev_err() wherever possible. In the few places that will not work out, use a basic printk(). Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 3 changed files with 48 additions and 30 deletions Side-by-side Diff
drivers/usb/class/cdc-acm.c
... | ... | @@ -326,8 +326,8 @@ |
326 | 326 | usb_mark_last_busy(acm->dev); |
327 | 327 | retval = usb_submit_urb (urb, GFP_ATOMIC); |
328 | 328 | if (retval) |
329 | - err ("%s - usb_submit_urb failed with result %d", | |
330 | - __func__, retval); | |
329 | + dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with " | |
330 | + "result %d", __func__, retval); | |
331 | 331 | } |
332 | 332 | |
333 | 333 | /* data interface returns incoming bytes, or we got unthrottled */ |
... | ... | @@ -514,7 +514,7 @@ |
514 | 514 | |
515 | 515 | rv = usb_autopm_get_interface(acm->control); |
516 | 516 | if (rv < 0) { |
517 | - err("Autopm failure in %s", __func__); | |
517 | + dev_err(&acm->dev->dev, "Autopm failure in %s\n", __func__); | |
518 | 518 | return; |
519 | 519 | } |
520 | 520 | if (acm->delayed_wb) { |
... | ... | @@ -924,7 +924,7 @@ |
924 | 924 | |
925 | 925 | /* normal probing*/ |
926 | 926 | if (!buffer) { |
927 | - err("Weird descriptor references\n"); | |
927 | + dev_err(&intf->dev, "Weird descriptor references\n"); | |
928 | 928 | return -EINVAL; |
929 | 929 | } |
930 | 930 | |
931 | 931 | |
932 | 932 | |
... | ... | @@ -934,21 +934,24 @@ |
934 | 934 | buflen = intf->cur_altsetting->endpoint->extralen; |
935 | 935 | buffer = intf->cur_altsetting->endpoint->extra; |
936 | 936 | } else { |
937 | - err("Zero length descriptor references\n"); | |
937 | + dev_err(&intf->dev, | |
938 | + "Zero length descriptor references\n"); | |
938 | 939 | return -EINVAL; |
939 | 940 | } |
940 | 941 | } |
941 | 942 | |
942 | 943 | while (buflen > 0) { |
943 | 944 | if (buffer [1] != USB_DT_CS_INTERFACE) { |
944 | - err("skipping garbage\n"); | |
945 | + dev_err(&intf->dev, "skipping garbage\n"); | |
945 | 946 | goto next_desc; |
946 | 947 | } |
947 | 948 | |
948 | 949 | switch (buffer [2]) { |
949 | 950 | case USB_CDC_UNION_TYPE: /* we've found it */ |
950 | 951 | if (union_header) { |
951 | - err("More than one union descriptor, skipping ..."); | |
952 | + dev_err(&intf->dev, "More than one " | |
953 | + "union descriptor, " | |
954 | + "skipping ...\n"); | |
952 | 955 | goto next_desc; |
953 | 956 | } |
954 | 957 | union_header = (struct usb_cdc_union_desc *) |
... | ... | @@ -966,7 +969,9 @@ |
966 | 969 | call_management_function = buffer[3]; |
967 | 970 | call_interface_num = buffer[4]; |
968 | 971 | if ((call_management_function & 3) != 3) |
969 | - err("This device cannot do calls on its own. It is no modem."); | |
972 | + dev_err(&intf->dev, "This device " | |
973 | + "cannot do calls on its own. " | |
974 | + "It is no modem.\n"); | |
970 | 975 | break; |
971 | 976 | default: |
972 | 977 | /* there are LOTS more CDC descriptors that |
... | ... | @@ -1051,7 +1056,7 @@ |
1051 | 1056 | for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++); |
1052 | 1057 | |
1053 | 1058 | if (minor == ACM_TTY_MINORS) { |
1054 | - err("no more free acm devices"); | |
1059 | + dev_err(&intf->dev, "no more free acm devices\n"); | |
1055 | 1060 | return -ENODEV; |
1056 | 1061 | } |
1057 | 1062 |
drivers/usb/class/cdc-wdm.c
... | ... | @@ -132,10 +132,12 @@ |
132 | 132 | "nonzero urb status received: -ESHUTDOWN"); |
133 | 133 | break; |
134 | 134 | case -EPIPE: |
135 | - err("nonzero urb status received: -EPIPE"); | |
135 | + dev_err(&desc->intf->dev, | |
136 | + "nonzero urb status received: -EPIPE\n"); | |
136 | 137 | break; |
137 | 138 | default: |
138 | - err("Unexpected error %d", status); | |
139 | + dev_err(&desc->intf->dev, | |
140 | + "Unexpected error %d\n", status); | |
139 | 141 | break; |
140 | 142 | } |
141 | 143 | } |
142 | 144 | |
143 | 145 | |
... | ... | @@ -170,16 +172,18 @@ |
170 | 172 | return; /* unplug */ |
171 | 173 | case -EPIPE: |
172 | 174 | set_bit(WDM_INT_STALL, &desc->flags); |
173 | - err("Stall on int endpoint"); | |
175 | + dev_err(&desc->intf->dev, "Stall on int endpoint\n"); | |
174 | 176 | goto sw; /* halt is cleared in work */ |
175 | 177 | default: |
176 | - err("nonzero urb status received: %d", status); | |
178 | + dev_err(&desc->intf->dev, | |
179 | + "nonzero urb status received: %d\n", status); | |
177 | 180 | break; |
178 | 181 | } |
179 | 182 | } |
180 | 183 | |
181 | 184 | if (urb->actual_length < sizeof(struct usb_cdc_notification)) { |
182 | - err("wdm_int_callback - %d bytes", urb->actual_length); | |
185 | + dev_err(&desc->intf->dev, "wdm_int_callback - %d bytes\n", | |
186 | + urb->actual_length); | |
183 | 187 | goto exit; |
184 | 188 | } |
185 | 189 | |
... | ... | @@ -198,7 +202,8 @@ |
198 | 202 | goto exit; |
199 | 203 | default: |
200 | 204 | clear_bit(WDM_POLL_RUNNING, &desc->flags); |
201 | - err("unknown notification %d received: index %d len %d", | |
205 | + dev_err(&desc->intf->dev, | |
206 | + "unknown notification %d received: index %d len %d\n", | |
202 | 207 | dr->bNotificationType, dr->wIndex, dr->wLength); |
203 | 208 | goto exit; |
204 | 209 | } |
205 | 210 | |
... | ... | @@ -236,14 +241,16 @@ |
236 | 241 | sw: |
237 | 242 | rv = schedule_work(&desc->rxwork); |
238 | 243 | if (rv) |
239 | - err("Cannot schedule work"); | |
244 | + dev_err(&desc->intf->dev, | |
245 | + "Cannot schedule work\n"); | |
240 | 246 | } |
241 | 247 | } |
242 | 248 | exit: |
243 | 249 | rv = usb_submit_urb(urb, GFP_ATOMIC); |
244 | 250 | if (rv) |
245 | - err("%s - usb_submit_urb failed with result %d", | |
246 | - __func__, rv); | |
251 | + dev_err(&desc->intf->dev, | |
252 | + "%s - usb_submit_urb failed with result %d\n", | |
253 | + __func__, rv); | |
247 | 254 | |
248 | 255 | } |
249 | 256 | |
... | ... | @@ -353,7 +360,7 @@ |
353 | 360 | if (rv < 0) { |
354 | 361 | kfree(buf); |
355 | 362 | clear_bit(WDM_IN_USE, &desc->flags); |
356 | - err("Tx URB error: %d", rv); | |
363 | + dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); | |
357 | 364 | } else { |
358 | 365 | dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", |
359 | 366 | req->wIndex); |
... | ... | @@ -401,7 +408,8 @@ |
401 | 408 | int t = desc->rerr; |
402 | 409 | desc->rerr = 0; |
403 | 410 | spin_unlock_irq(&desc->iuspin); |
404 | - err("reading had resulted in %d", t); | |
411 | + dev_err(&desc->intf->dev, | |
412 | + "reading had resulted in %d\n", t); | |
405 | 413 | rv = -EIO; |
406 | 414 | goto err; |
407 | 415 | } |
... | ... | @@ -440,7 +448,7 @@ |
440 | 448 | err: |
441 | 449 | mutex_unlock(&desc->rlock); |
442 | 450 | if (rv < 0) |
443 | - err("wdm_read: exit error"); | |
451 | + dev_err(&desc->intf->dev, "wdm_read: exit error\n"); | |
444 | 452 | return rv; |
445 | 453 | } |
446 | 454 | |
... | ... | @@ -450,7 +458,8 @@ |
450 | 458 | |
451 | 459 | wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags)); |
452 | 460 | if (desc->werr < 0) |
453 | - err("Error in flush path: %d", desc->werr); | |
461 | + dev_err(&desc->intf->dev, "Error in flush path: %d\n", | |
462 | + desc->werr); | |
454 | 463 | |
455 | 464 | return desc->werr; |
456 | 465 | } |
... | ... | @@ -502,7 +511,7 @@ |
502 | 511 | |
503 | 512 | rv = usb_autopm_get_interface(desc->intf); |
504 | 513 | if (rv < 0) { |
505 | - err("Error autopm - %d", rv); | |
514 | + dev_err(&desc->intf->dev, "Error autopm - %d\n", rv); | |
506 | 515 | goto out; |
507 | 516 | } |
508 | 517 | intf->needs_remote_wakeup = 1; |
... | ... | @@ -512,7 +521,8 @@ |
512 | 521 | rv = usb_submit_urb(desc->validity, GFP_KERNEL); |
513 | 522 | if (rv < 0) { |
514 | 523 | desc->count--; |
515 | - err("Error submitting int urb - %d", rv); | |
524 | + dev_err(&desc->intf->dev, | |
525 | + "Error submitting int urb - %d\n", rv); | |
516 | 526 | } |
517 | 527 | } else { |
518 | 528 | rv = 0; |
... | ... | @@ -600,7 +610,7 @@ |
600 | 610 | |
601 | 611 | while (buflen > 0) { |
602 | 612 | if (buffer [1] != USB_DT_CS_INTERFACE) { |
603 | - err("skipping garbage"); | |
613 | + dev_err(&intf->dev, "skipping garbage\n"); | |
604 | 614 | goto next_desc; |
605 | 615 | } |
606 | 616 | |
... | ... | @@ -614,7 +624,8 @@ |
614 | 624 | "Finding maximum buffer length: %d", maxcom); |
615 | 625 | break; |
616 | 626 | default: |
617 | - err("Ignoring extra header, type %d, length %d", | |
627 | + dev_err(&intf->dev, | |
628 | + "Ignoring extra header, type %d, length %d\n", | |
618 | 629 | buffer[2], buffer[0]); |
619 | 630 | break; |
620 | 631 | } |
... | ... | @@ -772,7 +783,8 @@ |
772 | 783 | if (desc->count) { |
773 | 784 | rv = usb_submit_urb(desc->validity, GFP_NOIO); |
774 | 785 | if (rv < 0) |
775 | - err("Error resume submitting int urb - %d", rv); | |
786 | + dev_err(&desc->intf->dev, | |
787 | + "Error resume submitting int urb - %d\n", rv); | |
776 | 788 | } |
777 | 789 | return rv; |
778 | 790 | } |
drivers/usb/class/usblp.c
... | ... | @@ -593,8 +593,9 @@ |
593 | 593 | err = usblp_hp_channel_change_request(usblp, |
594 | 594 | arg, &newChannel); |
595 | 595 | if (err < 0) { |
596 | - err("usblp%d: error = %d setting " | |
597 | - "HP channel", | |
596 | + dev_err(&usblp->dev->dev, | |
597 | + "usblp%d: error = %d setting " | |
598 | + "HP channel\n", | |
598 | 599 | usblp->minor, err); |
599 | 600 | retval = -EIO; |
600 | 601 | goto done; |
... | ... | @@ -1345,7 +1346,7 @@ |
1345 | 1346 | usb_deregister_dev(intf, &usblp_class); |
1346 | 1347 | |
1347 | 1348 | if (!usblp || !usblp->dev) { |
1348 | - err("bogus disconnect"); | |
1349 | + dev_err(&intf->dev, "bogus disconnect\n"); | |
1349 | 1350 | BUG (); |
1350 | 1351 | } |
1351 | 1352 |