aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/dabusb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2009-01-08 07:13:42 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:26 -0400
commitbe9ed5117d95cdc4e601f9da220ebeaaab131679 (patch)
tree9dc12b47951ded56ec654c579253e07514360fd2 /drivers/media/video/dabusb.c
parentf180152376c984a6faa9decb8f2811c373da9141 (diff)
V4L/DVB (10298): remove err macro from few usb devices
Patch removes err() macros from few usb devices. It places pr_err in pvrusb2-v4l2.c, dev_err in dabusb and in usbvision drivers. Beside placing dev_err, patch defines new s2255_dev_err macro with S2255_DRIVER_NAME in s2255 module. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Acked-by: Thierry Merle <thierry.merle@free.fr> Acked-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/dabusb.c')
-rw-r--r--drivers/media/video/dabusb.c70
1 files changed, 43 insertions, 27 deletions
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c
index 298810d5262b..f40c676489a4 100644
--- a/drivers/media/video/dabusb.c
+++ b/drivers/media/video/dabusb.c
@@ -189,17 +189,20 @@ static void dabusb_iso_complete (struct urb *purb)
189 dst += len; 189 dst += len;
190 } 190 }
191 else 191 else
192 err("dabusb_iso_complete: invalid len %d", len); 192 dev_err(&purb->dev->dev,
193 "dabusb_iso_complete: invalid len %d\n", len);
193 } 194 }
194 else 195 else
195 dev_warn(&purb->dev->dev, "dabusb_iso_complete: corrupted packet status: %d\n", purb->iso_frame_desc[i].status); 196 dev_warn(&purb->dev->dev, "dabusb_iso_complete: corrupted packet status: %d\n", purb->iso_frame_desc[i].status);
196 if (dst != purb->actual_length) 197 if (dst != purb->actual_length)
197 err("dst!=purb->actual_length:%d!=%d", dst, purb->actual_length); 198 dev_err(&purb->dev->dev,
199 "dst!=purb->actual_length:%d!=%d\n",
200 dst, purb->actual_length);
198 } 201 }
199 202
200 if (atomic_dec_and_test (&s->pending_io) && !s->remove_pending && s->state != _stopped) { 203 if (atomic_dec_and_test (&s->pending_io) && !s->remove_pending && s->state != _stopped) {
201 s->overruns++; 204 s->overruns++;
202 err("overrun (%d)", s->overruns); 205 dev_err(&purb->dev->dev, "overrun (%d)\n", s->overruns);
203 } 206 }
204 wake_up (&s->wait); 207 wake_up (&s->wait);
205} 208}
@@ -220,13 +223,14 @@ static int dabusb_alloc_buffers (pdabusb_t s)
220 while (transfer_len < (s->total_buffer_size << 10)) { 223 while (transfer_len < (s->total_buffer_size << 10)) {
221 b = kzalloc(sizeof (buff_t), GFP_KERNEL); 224 b = kzalloc(sizeof (buff_t), GFP_KERNEL);
222 if (!b) { 225 if (!b) {
223 err("kzalloc(sizeof(buff_t))==NULL"); 226 dev_err(&s->usbdev->dev,
227 "kzalloc(sizeof(buff_t))==NULL\n");
224 goto err; 228 goto err;
225 } 229 }
226 b->s = s; 230 b->s = s;
227 b->purb = usb_alloc_urb(packets, GFP_KERNEL); 231 b->purb = usb_alloc_urb(packets, GFP_KERNEL);
228 if (!b->purb) { 232 if (!b->purb) {
229 err("usb_alloc_urb == NULL"); 233 dev_err(&s->usbdev->dev, "usb_alloc_urb == NULL\n");
230 kfree (b); 234 kfree (b);
231 goto err; 235 goto err;
232 } 236 }
@@ -235,7 +239,8 @@ static int dabusb_alloc_buffers (pdabusb_t s)
235 if (!b->purb->transfer_buffer) { 239 if (!b->purb->transfer_buffer) {
236 kfree (b->purb); 240 kfree (b->purb);
237 kfree (b); 241 kfree (b);
238 err("kmalloc(%d)==NULL", transfer_buffer_length); 242 dev_err(&s->usbdev->dev,
243 "kmalloc(%d)==NULL\n", transfer_buffer_length);
239 goto err; 244 goto err;
240 } 245 }
241 246
@@ -279,10 +284,11 @@ static int dabusb_bulk (pdabusb_t s, pbulk_transfer_t pb)
279 284
280 ret=usb_bulk_msg(s->usbdev, pipe, pb->data, pb->size, &actual_length, 100); 285 ret=usb_bulk_msg(s->usbdev, pipe, pb->data, pb->size, &actual_length, 100);
281 if(ret<0) { 286 if(ret<0) {
282 err("dabusb: usb_bulk_msg failed(%d)",ret); 287 dev_err(&s->usbdev->dev,
288 "usb_bulk_msg failed(%d)\n", ret);
283 289
284 if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) { 290 if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
285 err("set_interface failed"); 291 dev_err(&s->usbdev->dev, "set_interface failed\n");
286 return -EINVAL; 292 return -EINVAL;
287 } 293 }
288 294
@@ -291,7 +297,7 @@ static int dabusb_bulk (pdabusb_t s, pbulk_transfer_t pb)
291 if( ret == -EPIPE ) { 297 if( ret == -EPIPE ) {
292 dev_warn(&s->usbdev->dev, "CLEAR_FEATURE request to remove STALL condition.\n"); 298 dev_warn(&s->usbdev->dev, "CLEAR_FEATURE request to remove STALL condition.\n");
293 if(usb_clear_halt(s->usbdev, usb_pipeendpoint(pipe))) 299 if(usb_clear_halt(s->usbdev, usb_pipeendpoint(pipe)))
294 err("request failed"); 300 dev_err(&s->usbdev->dev, "request failed\n");
295 } 301 }
296 302
297 pb->size = actual_length; 303 pb->size = actual_length;
@@ -305,7 +311,8 @@ static int dabusb_writemem (pdabusb_t s, int pos, const unsigned char *data,
305 unsigned char *transfer_buffer = kmalloc (len, GFP_KERNEL); 311 unsigned char *transfer_buffer = kmalloc (len, GFP_KERNEL);
306 312
307 if (!transfer_buffer) { 313 if (!transfer_buffer) {
308 err("dabusb_writemem: kmalloc(%d) failed.", len); 314 dev_err(&s->usbdev->dev,
315 "dabusb_writemem: kmalloc(%d) failed.\n", len);
309 return -ENOMEM; 316 return -ENOMEM;
310 } 317 }
311 318
@@ -333,7 +340,8 @@ static int dabusb_loadmem (pdabusb_t s, const char *fname)
333 340
334 ret = request_ihex_firmware(&fw, "dabusb/firmware.fw", &s->usbdev->dev); 341 ret = request_ihex_firmware(&fw, "dabusb/firmware.fw", &s->usbdev->dev);
335 if (ret) { 342 if (ret) {
336 err("Failed to load \"dabusb/firmware.fw\": %d\n", ret); 343 dev_err(&s->usbdev->dev,
344 "Failed to load \"dabusb/firmware.fw\": %d\n", ret);
337 goto out; 345 goto out;
338 } 346 }
339 ret = dabusb_8051_reset (s, 1); 347 ret = dabusb_8051_reset (s, 1);
@@ -346,9 +354,10 @@ static int dabusb_loadmem (pdabusb_t s, const char *fname)
346 ret = dabusb_writemem(s, be32_to_cpu(rec->addr), rec->data, 354 ret = dabusb_writemem(s, be32_to_cpu(rec->addr), rec->data,
347 be16_to_cpu(rec->len)); 355 be16_to_cpu(rec->len));
348 if (ret < 0) { 356 if (ret < 0) {
349 err("dabusb_writemem failed (%d %04X %p %d)", ret, 357 dev_err(&s->usbdev->dev,
350 be32_to_cpu(rec->addr), rec->data, 358 "dabusb_writemem failed (%d %04X %p %d)\n",
351 be16_to_cpu(rec->len)); 359 ret, be32_to_cpu(rec->addr),
360 rec->data, be16_to_cpu(rec->len));
352 break; 361 break;
353 } 362 }
354 } 363 }
@@ -396,13 +405,15 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname)
396 dbg("Enter dabusb_fpga_download (internal)"); 405 dbg("Enter dabusb_fpga_download (internal)");
397 406
398 if (!b) { 407 if (!b) {
399 err("kmalloc(sizeof(bulk_transfer_t))==NULL"); 408 dev_err(&s->usbdev->dev,
409 "kmalloc(sizeof(bulk_transfer_t))==NULL\n");
400 return -ENOMEM; 410 return -ENOMEM;
401 } 411 }
402 412
403 ret = request_firmware(&fw, "dabusb/bitstream.bin", &s->usbdev->dev); 413 ret = request_firmware(&fw, "dabusb/bitstream.bin", &s->usbdev->dev);
404 if (ret) { 414 if (ret) {
405 err("Failed to load \"dabusb/bitstream.bin\": %d\n", ret); 415 dev_err(&s->usbdev->dev,
416 "Failed to load \"dabusb/bitstream.bin\": %d\n", ret);
406 kfree(b); 417 kfree(b);
407 return ret; 418 return ret;
408 } 419 }
@@ -425,7 +436,7 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname)
425 memcpy (b->data + 4, fw->data + 74 + n, 60); 436 memcpy (b->data + 4, fw->data + 74 + n, 60);
426 ret = dabusb_bulk (s, b); 437 ret = dabusb_bulk (s, b);
427 if (ret < 0) { 438 if (ret < 0) {
428 err("dabusb_bulk failed."); 439 dev_err(&s->usbdev->dev, "dabusb_bulk failed.\n");
429 break; 440 break;
430 } 441 }
431 mdelay (1); 442 mdelay (1);
@@ -478,9 +489,11 @@ static int dabusb_startrek (pdabusb_t s)
478 489
479 ret = usb_submit_urb (end->purb, GFP_KERNEL); 490 ret = usb_submit_urb (end->purb, GFP_KERNEL);
480 if (ret) { 491 if (ret) {
481 err("usb_submit_urb returned:%d", ret); 492 dev_err(&s->usbdev->dev,
493 "usb_submit_urb returned:%d\n", ret);
482 if (dabusb_add_buf_tail (s, &s->free_buff_list, &s->rec_buff_list)) 494 if (dabusb_add_buf_tail (s, &s->free_buff_list, &s->rec_buff_list))
483 err("startrek: dabusb_add_buf_tail failed"); 495 dev_err(&s->usbdev->dev,
496 "startrek: dabusb_add_buf_tail failed\n");
484 break; 497 break;
485 } 498 }
486 else 499 else
@@ -523,7 +536,8 @@ static ssize_t dabusb_read (struct file *file, char __user *buf, size_t count, l
523 536
524 spin_unlock_irqrestore(&s->lock, flags); 537 spin_unlock_irqrestore(&s->lock, flags);
525 538
526 err("error: rec_buf_list is empty"); 539 dev_err(&s->usbdev->dev,
540 "error: rec_buf_list is empty\n");
527 goto err; 541 goto err;
528 } 542 }
529 543
@@ -552,7 +566,8 @@ static ssize_t dabusb_read (struct file *file, char __user *buf, size_t count, l
552 566
553 if (list_empty (&s->rec_buff_list)) { 567 if (list_empty (&s->rec_buff_list)) {
554 spin_unlock_irqrestore(&s->lock, flags); 568 spin_unlock_irqrestore(&s->lock, flags);
555 err("error: still no buffer available."); 569 dev_err(&s->usbdev->dev,
570 "error: still no buffer available.\n");
556 goto err; 571 goto err;
557 } 572 }
558 spin_unlock_irqrestore(&s->lock, flags); 573 spin_unlock_irqrestore(&s->lock, flags);
@@ -573,7 +588,7 @@ static ssize_t dabusb_read (struct file *file, char __user *buf, size_t count, l
573 dbg("copy_to_user:%p %p %d",buf, purb->transfer_buffer + s->readptr, cnt); 588 dbg("copy_to_user:%p %p %d",buf, purb->transfer_buffer + s->readptr, cnt);
574 589
575 if (copy_to_user (buf, purb->transfer_buffer + s->readptr, cnt)) { 590 if (copy_to_user (buf, purb->transfer_buffer + s->readptr, cnt)) {
576 err("read: copy_to_user failed"); 591 dev_err(&s->usbdev->dev, "read: copy_to_user failed\n");
577 if (!ret) 592 if (!ret)
578 ret = -EFAULT; 593 ret = -EFAULT;
579 goto err; 594 goto err;
@@ -587,7 +602,8 @@ static ssize_t dabusb_read (struct file *file, char __user *buf, size_t count, l
587 if (s->readptr == purb->actual_length) { 602 if (s->readptr == purb->actual_length) {
588 // finished, take next buffer 603 // finished, take next buffer
589 if (dabusb_add_buf_tail (s, &s->free_buff_list, &s->rec_buff_list)) 604 if (dabusb_add_buf_tail (s, &s->free_buff_list, &s->rec_buff_list))
590 err("read: dabusb_add_buf_tail failed"); 605 dev_err(&s->usbdev->dev,
606 "read: dabusb_add_buf_tail failed\n");
591 s->readptr = 0; 607 s->readptr = 0;
592 } 608 }
593 } 609 }
@@ -623,7 +639,7 @@ static int dabusb_open (struct inode *inode, struct file *file)
623 } 639 }
624 if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) { 640 if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
625 mutex_unlock(&s->mutex); 641 mutex_unlock(&s->mutex);
626 err("set_interface failed"); 642 dev_err(&s->usbdev->dev, "set_interface failed\n");
627 return -EINVAL; 643 return -EINVAL;
628 } 644 }
629 s->opened = 1; 645 s->opened = 1;
@@ -648,7 +664,7 @@ static int dabusb_release (struct inode *inode, struct file *file)
648 664
649 if (!s->remove_pending) { 665 if (!s->remove_pending) {
650 if (usb_set_interface (s->usbdev, _DABUSB_IF, 0) < 0) 666 if (usb_set_interface (s->usbdev, _DABUSB_IF, 0) < 0)
651 err("set_interface failed"); 667 dev_err(&s->usbdev->dev, "set_interface failed\n");
652 } 668 }
653 else 669 else
654 wake_up (&s->remove_ok); 670 wake_up (&s->remove_ok);
@@ -764,7 +780,7 @@ static int dabusb_probe (struct usb_interface *intf,
764 s->devnum = intf->minor; 780 s->devnum = intf->minor;
765 781
766 if (usb_reset_configuration (usbdev) < 0) { 782 if (usb_reset_configuration (usbdev) < 0) {
767 err("reset_configuration failed"); 783 dev_err(&intf->dev, "reset_configuration failed\n");
768 goto reject; 784 goto reject;
769 } 785 }
770 if (le16_to_cpu(usbdev->descriptor.idProduct) == 0x2131) { 786 if (le16_to_cpu(usbdev->descriptor.idProduct) == 0x2131) {
@@ -775,7 +791,7 @@ static int dabusb_probe (struct usb_interface *intf,
775 dabusb_fpga_download (s, NULL); 791 dabusb_fpga_download (s, NULL);
776 792
777 if (usb_set_interface (s->usbdev, _DABUSB_IF, 0) < 0) { 793 if (usb_set_interface (s->usbdev, _DABUSB_IF, 0) < 0) {
778 err("set_interface failed"); 794 dev_err(&intf->dev, "set_interface failed\n");
779 goto reject; 795 goto reject;
780 } 796 }
781 } 797 }