aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class/cdc-wdm.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-08-14 12:37:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-17 17:41:10 -0400
commit9908a32e94de2141463e104c9924279ed3509447 (patch)
tree5db2098a164a574662ce9a0a1cb86ce61ed5ca09 /drivers/usb/class/cdc-wdm.c
parent194343d9364ea07c9f27c4505380a15a905e8a24 (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/usb/class/cdc-wdm.c')
-rw-r--r--drivers/usb/class/cdc-wdm.c48
1 files changed, 30 insertions, 18 deletions
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)
236sw: 241sw:
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 }
242exit: 248exit:
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:
440err: 448err:
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}