diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-14 12:37:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-17 17:41:10 -0400 |
commit | 9908a32e94de2141463e104c9924279ed3509447 (patch) | |
tree | 5db2098a164a574662ce9a0a1cb86ce61ed5ca09 /drivers | |
parent | 194343d9364ea07c9f27c4505380a15a905e8a24 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 23 | ||||
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 48 | ||||
-rw-r--r-- | drivers/usb/class/usblp.c | 7 |
3 files changed, 48 insertions, 30 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index d9c2b8dafd67..fab23ee8702b 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -326,8 +326,8 @@ exit: | |||
326 | usb_mark_last_busy(acm->dev); | 326 | usb_mark_last_busy(acm->dev); |
327 | retval = usb_submit_urb (urb, GFP_ATOMIC); | 327 | retval = usb_submit_urb (urb, GFP_ATOMIC); |
328 | if (retval) | 328 | if (retval) |
329 | err ("%s - usb_submit_urb failed with result %d", | 329 | dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with " |
330 | __func__, retval); | 330 | "result %d", __func__, retval); |
331 | } | 331 | } |
332 | 332 | ||
333 | /* data interface returns incoming bytes, or we got unthrottled */ | 333 | /* data interface returns incoming bytes, or we got unthrottled */ |
@@ -514,7 +514,7 @@ static void acm_waker(struct work_struct *waker) | |||
514 | 514 | ||
515 | rv = usb_autopm_get_interface(acm->control); | 515 | rv = usb_autopm_get_interface(acm->control); |
516 | if (rv < 0) { | 516 | if (rv < 0) { |
517 | err("Autopm failure in %s", __func__); | 517 | dev_err(&acm->dev->dev, "Autopm failure in %s\n", __func__); |
518 | return; | 518 | return; |
519 | } | 519 | } |
520 | if (acm->delayed_wb) { | 520 | if (acm->delayed_wb) { |
@@ -924,7 +924,7 @@ static int acm_probe (struct usb_interface *intf, | |||
924 | 924 | ||
925 | /* normal probing*/ | 925 | /* normal probing*/ |
926 | if (!buffer) { | 926 | if (!buffer) { |
927 | err("Weird descriptor references\n"); | 927 | dev_err(&intf->dev, "Weird descriptor references\n"); |
928 | return -EINVAL; | 928 | return -EINVAL; |
929 | } | 929 | } |
930 | 930 | ||
@@ -934,21 +934,24 @@ static int acm_probe (struct usb_interface *intf, | |||
934 | buflen = intf->cur_altsetting->endpoint->extralen; | 934 | buflen = intf->cur_altsetting->endpoint->extralen; |
935 | buffer = intf->cur_altsetting->endpoint->extra; | 935 | buffer = intf->cur_altsetting->endpoint->extra; |
936 | } else { | 936 | } else { |
937 | err("Zero length descriptor references\n"); | 937 | dev_err(&intf->dev, |
938 | "Zero length descriptor references\n"); | ||
938 | return -EINVAL; | 939 | return -EINVAL; |
939 | } | 940 | } |
940 | } | 941 | } |
941 | 942 | ||
942 | while (buflen > 0) { | 943 | while (buflen > 0) { |
943 | if (buffer [1] != USB_DT_CS_INTERFACE) { | 944 | if (buffer [1] != USB_DT_CS_INTERFACE) { |
944 | err("skipping garbage\n"); | 945 | dev_err(&intf->dev, "skipping garbage\n"); |
945 | goto next_desc; | 946 | goto next_desc; |
946 | } | 947 | } |
947 | 948 | ||
948 | switch (buffer [2]) { | 949 | switch (buffer [2]) { |
949 | case USB_CDC_UNION_TYPE: /* we've found it */ | 950 | case USB_CDC_UNION_TYPE: /* we've found it */ |
950 | if (union_header) { | 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 | goto next_desc; | 955 | goto next_desc; |
953 | } | 956 | } |
954 | union_header = (struct usb_cdc_union_desc *) | 957 | union_header = (struct usb_cdc_union_desc *) |
@@ -966,7 +969,9 @@ static int acm_probe (struct usb_interface *intf, | |||
966 | call_management_function = buffer[3]; | 969 | call_management_function = buffer[3]; |
967 | call_interface_num = buffer[4]; | 970 | call_interface_num = buffer[4]; |
968 | if ((call_management_function & 3) != 3) | 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 | break; | 975 | break; |
971 | default: | 976 | default: |
972 | /* there are LOTS more CDC descriptors that | 977 | /* there are LOTS more CDC descriptors that |
@@ -1051,7 +1056,7 @@ skip_normal_probe: | |||
1051 | for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++); | 1056 | for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++); |
1052 | 1057 | ||
1053 | if (minor == ACM_TTY_MINORS) { | 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 | return -ENODEV; | 1060 | return -ENODEV; |
1056 | } | 1061 | } |
1057 | 1062 | ||
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 7e8e1235e4e5..7429f70b9d06 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -132,10 +132,12 @@ static void wdm_in_callback(struct urb *urb) | |||
132 | "nonzero urb status received: -ESHUTDOWN"); | 132 | "nonzero urb status received: -ESHUTDOWN"); |
133 | break; | 133 | break; |
134 | case -EPIPE: | 134 | case -EPIPE: |
135 | err("nonzero urb status received: -EPIPE"); | 135 | dev_err(&desc->intf->dev, |
136 | "nonzero urb status received: -EPIPE\n"); | ||
136 | break; | 137 | break; |
137 | default: | 138 | default: |
138 | err("Unexpected error %d", status); | 139 | dev_err(&desc->intf->dev, |
140 | "Unexpected error %d\n", status); | ||
139 | break; | 141 | break; |
140 | } | 142 | } |
141 | } | 143 | } |
@@ -170,16 +172,18 @@ static void wdm_int_callback(struct urb *urb) | |||
170 | return; /* unplug */ | 172 | return; /* unplug */ |
171 | case -EPIPE: | 173 | case -EPIPE: |
172 | set_bit(WDM_INT_STALL, &desc->flags); | 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 | goto sw; /* halt is cleared in work */ | 176 | goto sw; /* halt is cleared in work */ |
175 | default: | 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 | break; | 180 | break; |
178 | } | 181 | } |
179 | } | 182 | } |
180 | 183 | ||
181 | if (urb->actual_length < sizeof(struct usb_cdc_notification)) { | 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 | goto exit; | 187 | goto exit; |
184 | } | 188 | } |
185 | 189 | ||
@@ -198,7 +202,8 @@ static void wdm_int_callback(struct urb *urb) | |||
198 | goto exit; | 202 | goto exit; |
199 | default: | 203 | default: |
200 | clear_bit(WDM_POLL_RUNNING, &desc->flags); | 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 | dr->bNotificationType, dr->wIndex, dr->wLength); | 207 | dr->bNotificationType, dr->wIndex, dr->wLength); |
203 | goto exit; | 208 | goto exit; |
204 | } | 209 | } |
@@ -236,14 +241,16 @@ static void wdm_int_callback(struct urb *urb) | |||
236 | sw: | 241 | sw: |
237 | rv = schedule_work(&desc->rxwork); | 242 | rv = schedule_work(&desc->rxwork); |
238 | if (rv) | 243 | if (rv) |
239 | err("Cannot schedule work"); | 244 | dev_err(&desc->intf->dev, |
245 | "Cannot schedule work\n"); | ||
240 | } | 246 | } |
241 | } | 247 | } |
242 | exit: | 248 | exit: |
243 | rv = usb_submit_urb(urb, GFP_ATOMIC); | 249 | rv = usb_submit_urb(urb, GFP_ATOMIC); |
244 | if (rv) | 250 | if (rv) |
245 | err("%s - usb_submit_urb failed with result %d", | 251 | dev_err(&desc->intf->dev, |
246 | __func__, rv); | 252 | "%s - usb_submit_urb failed with result %d\n", |
253 | __func__, rv); | ||
247 | 254 | ||
248 | } | 255 | } |
249 | 256 | ||
@@ -353,7 +360,7 @@ static ssize_t wdm_write | |||
353 | if (rv < 0) { | 360 | if (rv < 0) { |
354 | kfree(buf); | 361 | kfree(buf); |
355 | clear_bit(WDM_IN_USE, &desc->flags); | 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 | } else { | 364 | } else { |
358 | dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", | 365 | dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", |
359 | req->wIndex); | 366 | req->wIndex); |
@@ -401,7 +408,8 @@ retry: | |||
401 | int t = desc->rerr; | 408 | int t = desc->rerr; |
402 | desc->rerr = 0; | 409 | desc->rerr = 0; |
403 | spin_unlock_irq(&desc->iuspin); | 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 | rv = -EIO; | 413 | rv = -EIO; |
406 | goto err; | 414 | goto err; |
407 | } | 415 | } |
@@ -440,7 +448,7 @@ retry: | |||
440 | err: | 448 | err: |
441 | mutex_unlock(&desc->rlock); | 449 | mutex_unlock(&desc->rlock); |
442 | if (rv < 0) | 450 | if (rv < 0) |
443 | err("wdm_read: exit error"); | 451 | dev_err(&desc->intf->dev, "wdm_read: exit error\n"); |
444 | return rv; | 452 | return rv; |
445 | } | 453 | } |
446 | 454 | ||
@@ -450,7 +458,8 @@ static int wdm_flush(struct file *file, fl_owner_t id) | |||
450 | 458 | ||
451 | wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags)); | 459 | wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags)); |
452 | if (desc->werr < 0) | 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 | return desc->werr; | 464 | return desc->werr; |
456 | } | 465 | } |
@@ -502,7 +511,7 @@ static int wdm_open(struct inode *inode, struct file *file) | |||
502 | 511 | ||
503 | rv = usb_autopm_get_interface(desc->intf); | 512 | rv = usb_autopm_get_interface(desc->intf); |
504 | if (rv < 0) { | 513 | if (rv < 0) { |
505 | err("Error autopm - %d", rv); | 514 | dev_err(&desc->intf->dev, "Error autopm - %d\n", rv); |
506 | goto out; | 515 | goto out; |
507 | } | 516 | } |
508 | intf->needs_remote_wakeup = 1; | 517 | intf->needs_remote_wakeup = 1; |
@@ -512,7 +521,8 @@ static int wdm_open(struct inode *inode, struct file *file) | |||
512 | rv = usb_submit_urb(desc->validity, GFP_KERNEL); | 521 | rv = usb_submit_urb(desc->validity, GFP_KERNEL); |
513 | if (rv < 0) { | 522 | if (rv < 0) { |
514 | desc->count--; | 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 | } else { | 527 | } else { |
518 | rv = 0; | 528 | rv = 0; |
@@ -600,7 +610,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
600 | 610 | ||
601 | while (buflen > 0) { | 611 | while (buflen > 0) { |
602 | if (buffer [1] != USB_DT_CS_INTERFACE) { | 612 | if (buffer [1] != USB_DT_CS_INTERFACE) { |
603 | err("skipping garbage"); | 613 | dev_err(&intf->dev, "skipping garbage\n"); |
604 | goto next_desc; | 614 | goto next_desc; |
605 | } | 615 | } |
606 | 616 | ||
@@ -614,7 +624,8 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
614 | "Finding maximum buffer length: %d", maxcom); | 624 | "Finding maximum buffer length: %d", maxcom); |
615 | break; | 625 | break; |
616 | default: | 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 | buffer[2], buffer[0]); | 629 | buffer[2], buffer[0]); |
619 | break; | 630 | break; |
620 | } | 631 | } |
@@ -772,7 +783,8 @@ static int recover_from_urb_loss(struct wdm_device *desc) | |||
772 | if (desc->count) { | 783 | if (desc->count) { |
773 | rv = usb_submit_urb(desc->validity, GFP_NOIO); | 784 | rv = usb_submit_urb(desc->validity, GFP_NOIO); |
774 | if (rv < 0) | 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 | return rv; | 789 | return rv; |
778 | } | 790 | } |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 68a2239cd0b6..b5775af3ba26 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -593,8 +593,9 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
593 | err = usblp_hp_channel_change_request(usblp, | 593 | err = usblp_hp_channel_change_request(usblp, |
594 | arg, &newChannel); | 594 | arg, &newChannel); |
595 | if (err < 0) { | 595 | if (err < 0) { |
596 | err("usblp%d: error = %d setting " | 596 | dev_err(&usblp->dev->dev, |
597 | "HP channel", | 597 | "usblp%d: error = %d setting " |
598 | "HP channel\n", | ||
598 | usblp->minor, err); | 599 | usblp->minor, err); |
599 | retval = -EIO; | 600 | retval = -EIO; |
600 | goto done; | 601 | goto done; |
@@ -1345,7 +1346,7 @@ static void usblp_disconnect(struct usb_interface *intf) | |||
1345 | usb_deregister_dev(intf, &usblp_class); | 1346 | usb_deregister_dev(intf, &usblp_class); |
1346 | 1347 | ||
1347 | if (!usblp || !usblp->dev) { | 1348 | if (!usblp || !usblp->dev) { |
1348 | err("bogus disconnect"); | 1349 | dev_err(&intf->dev, "bogus disconnect\n"); |
1349 | BUG (); | 1350 | BUG (); |
1350 | } | 1351 | } |
1351 | 1352 | ||