aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/usb-skeleton.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-27 14:24:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-27 14:24:45 -0400
commit4212cd74ca6f0c42f5a0065797dd1c310a485ad8 (patch)
treed73e99ff299c80980da15c8fc018cedb6f65737e /drivers/usb/usb-skeleton.c
parentd57b177208b6ec20cacd7321ee32ef02f9f9e7fa (diff)
USB: usb-skeleton.c: remove err() usage
err() was a very old USB-specific macro that I thought had gone away. This patch removes it from being used in the driver and uses dev_err() instead. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usb-skeleton.c')
-rw-r--r--drivers/usb/usb-skeleton.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index b4a71679c933..0616f235bd6b 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -93,8 +93,8 @@ static int skel_open(struct inode *inode, struct file *file)
93 93
94 interface = usb_find_interface(&skel_driver, subminor); 94 interface = usb_find_interface(&skel_driver, subminor);
95 if (!interface) { 95 if (!interface) {
96 err("%s - error, can't find device for minor %d", 96 pr_err("%s - error, can't find device for minor %d\n",
97 __func__, subminor); 97 __func__, subminor);
98 retval = -ENODEV; 98 retval = -ENODEV;
99 goto exit; 99 goto exit;
100 } 100 }
@@ -179,8 +179,9 @@ static void skel_read_bulk_callback(struct urb *urb)
179 if (!(urb->status == -ENOENT || 179 if (!(urb->status == -ENOENT ||
180 urb->status == -ECONNRESET || 180 urb->status == -ECONNRESET ||
181 urb->status == -ESHUTDOWN)) 181 urb->status == -ESHUTDOWN))
182 err("%s - nonzero write bulk status received: %d", 182 dev_err(&dev->interface->dev,
183 __func__, urb->status); 183 "%s - nonzero write bulk status received: %d\n",
184 __func__, urb->status);
184 185
185 dev->errors = urb->status; 186 dev->errors = urb->status;
186 } else { 187 } else {
@@ -213,7 +214,8 @@ static int skel_do_read_io(struct usb_skel *dev, size_t count)
213 /* do it */ 214 /* do it */
214 rv = usb_submit_urb(dev->bulk_in_urb, GFP_KERNEL); 215 rv = usb_submit_urb(dev->bulk_in_urb, GFP_KERNEL);
215 if (rv < 0) { 216 if (rv < 0) {
216 err("%s - failed submitting read urb, error %d", 217 dev_err(&dev->interface->dev,
218 "%s - failed submitting read urb, error %d\n",
217 __func__, rv); 219 __func__, rv);
218 dev->bulk_in_filled = 0; 220 dev->bulk_in_filled = 0;
219 rv = (rv == -ENOMEM) ? rv : -EIO; 221 rv = (rv == -ENOMEM) ? rv : -EIO;
@@ -364,8 +366,9 @@ static void skel_write_bulk_callback(struct urb *urb)
364 if (!(urb->status == -ENOENT || 366 if (!(urb->status == -ENOENT ||
365 urb->status == -ECONNRESET || 367 urb->status == -ECONNRESET ||
366 urb->status == -ESHUTDOWN)) 368 urb->status == -ESHUTDOWN))
367 err("%s - nonzero write bulk status received: %d", 369 dev_err(&dev->interface->dev,
368 __func__, urb->status); 370 "%s - nonzero write bulk status received: %d\n",
371 __func__, urb->status);
369 372
370 spin_lock(&dev->err_lock); 373 spin_lock(&dev->err_lock);
371 dev->errors = urb->status; 374 dev->errors = urb->status;
@@ -459,8 +462,9 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
459 retval = usb_submit_urb(urb, GFP_KERNEL); 462 retval = usb_submit_urb(urb, GFP_KERNEL);
460 mutex_unlock(&dev->io_mutex); 463 mutex_unlock(&dev->io_mutex);
461 if (retval) { 464 if (retval) {
462 err("%s - failed submitting write urb, error %d", __func__, 465 dev_err(&dev->interface->dev,
463 retval); 466 "%s - failed submitting write urb, error %d\n",
467 __func__, retval);
464 goto error_unanchor; 468 goto error_unanchor;
465 } 469 }
466 470
@@ -519,7 +523,7 @@ static int skel_probe(struct usb_interface *interface,
519 /* allocate memory for our device state and initialize it */ 523 /* allocate memory for our device state and initialize it */
520 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 524 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
521 if (!dev) { 525 if (!dev) {
522 err("Out of memory"); 526 dev_err(&interface->dev, "Out of memory\n");
523 goto error; 527 goto error;
524 } 528 }
525 kref_init(&dev->kref); 529 kref_init(&dev->kref);
@@ -546,12 +550,14 @@ static int skel_probe(struct usb_interface *interface,
546 dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; 550 dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
547 dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); 551 dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
548 if (!dev->bulk_in_buffer) { 552 if (!dev->bulk_in_buffer) {
549 err("Could not allocate bulk_in_buffer"); 553 dev_err(&interface->dev,
554 "Could not allocate bulk_in_buffer\n");
550 goto error; 555 goto error;
551 } 556 }
552 dev->bulk_in_urb = usb_alloc_urb(0, GFP_KERNEL); 557 dev->bulk_in_urb = usb_alloc_urb(0, GFP_KERNEL);
553 if (!dev->bulk_in_urb) { 558 if (!dev->bulk_in_urb) {
554 err("Could not allocate bulk_in_urb"); 559 dev_err(&interface->dev,
560 "Could not allocate bulk_in_urb\n");
555 goto error; 561 goto error;
556 } 562 }
557 } 563 }
@@ -563,7 +569,8 @@ static int skel_probe(struct usb_interface *interface,
563 } 569 }
564 } 570 }
565 if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) { 571 if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) {
566 err("Could not find both bulk-in and bulk-out endpoints"); 572 dev_err(&interface->dev,
573 "Could not find both bulk-in and bulk-out endpoints\n");
567 goto error; 574 goto error;
568 } 575 }
569 576
@@ -574,7 +581,8 @@ static int skel_probe(struct usb_interface *interface,
574 retval = usb_register_dev(interface, &skel_class); 581 retval = usb_register_dev(interface, &skel_class);
575 if (retval) { 582 if (retval) {
576 /* something prevented us from registering this driver */ 583 /* something prevented us from registering this driver */
577 err("Not able to get a minor for this device."); 584 dev_err(&interface->dev,
585 "Not able to get a minor for this device.\n");
578 usb_set_intfdata(interface, NULL); 586 usb_set_intfdata(interface, NULL);
579 goto error; 587 goto error;
580 } 588 }