aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
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
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')
-rw-r--r--drivers/media/video/dabusb.c70
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c12
-rw-r--r--drivers/media/video/s2255drv.c38
-rw-r--r--drivers/media/video/usbvision/usbvision-core.c44
-rw-r--r--drivers/media/video/usbvision/usbvision-i2c.c6
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c36
6 files changed, 126 insertions, 80 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 }
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 3163c6df448a..b7caf135ed55 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -1268,8 +1268,9 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1268 dip->minor_type = pvr2_v4l_type_video; 1268 dip->minor_type = pvr2_v4l_type_video;
1269 nr_ptr = video_nr; 1269 nr_ptr = video_nr;
1270 if (!dip->stream) { 1270 if (!dip->stream) {
1271 err("Failed to set up pvrusb2 v4l video dev" 1271 pr_err(KBUILD_MODNAME
1272 " due to missing stream instance"); 1272 ": Failed to set up pvrusb2 v4l video dev"
1273 " due to missing stream instance\n");
1273 return; 1274 return;
1274 } 1275 }
1275 break; 1276 break;
@@ -1286,8 +1287,8 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1286 break; 1287 break;
1287 default: 1288 default:
1288 /* Bail out (this should be impossible) */ 1289 /* Bail out (this should be impossible) */
1289 err("Failed to set up pvrusb2 v4l dev" 1290 pr_err(KBUILD_MODNAME ": Failed to set up pvrusb2 v4l dev"
1290 " due to unrecognized config"); 1291 " due to unrecognized config\n");
1291 return; 1292 return;
1292 } 1293 }
1293 1294
@@ -1303,7 +1304,8 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1303 dip->v4l_type, mindevnum) < 0) && 1304 dip->v4l_type, mindevnum) < 0) &&
1304 (video_register_device(&dip->devbase, 1305 (video_register_device(&dip->devbase,
1305 dip->v4l_type, -1) < 0)) { 1306 dip->v4l_type, -1) < 0)) {
1306 err("Failed to register pvrusb2 v4l device"); 1307 pr_err(KBUILD_MODNAME
1308 ": Failed to register pvrusb2 v4l device\n");
1307 } 1309 }
1308 1310
1309 printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n", 1311 printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n",
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 13f85ad363cd..31bc94075268 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -336,14 +336,19 @@ static long s2255_vendor_req(struct s2255_dev *dev, unsigned char req,
336 u16 index, u16 value, void *buf, 336 u16 index, u16 value, void *buf,
337 s32 buf_len, int bOut); 337 s32 buf_len, int bOut);
338 338
339/* dev_err macro with driver name */
340#define S2255_DRIVER_NAME "s2255"
341#define s2255_dev_err(dev, fmt, arg...) \
342 dev_err(dev, S2255_DRIVER_NAME " - " fmt, ##arg)
343
339#define dprintk(level, fmt, arg...) \ 344#define dprintk(level, fmt, arg...) \
340 do { \ 345 do { \
341 if (*s2255_debug >= (level)) { \ 346 if (*s2255_debug >= (level)) { \
342 printk(KERN_DEBUG "s2255: " fmt, ##arg); \ 347 printk(KERN_DEBUG S2255_DRIVER_NAME \
348 ": " fmt, ##arg); \
343 } \ 349 } \
344 } while (0) 350 } while (0)
345 351
346
347static struct usb_driver s2255_driver; 352static struct usb_driver s2255_driver;
348 353
349 354
@@ -528,14 +533,14 @@ static void s2255_fwchunk_complete(struct urb *urb)
528 int len; 533 int len;
529 dprintk(100, "udev %p urb %p", udev, urb); 534 dprintk(100, "udev %p urb %p", udev, urb);
530 if (urb->status) { 535 if (urb->status) {
531 dev_err(&udev->dev, "URB failed with status %d", urb->status); 536 dev_err(&udev->dev, "URB failed with status %d\n", urb->status);
532 atomic_set(&data->fw_state, S2255_FW_FAILED); 537 atomic_set(&data->fw_state, S2255_FW_FAILED);
533 /* wake up anything waiting for the firmware */ 538 /* wake up anything waiting for the firmware */
534 wake_up(&data->wait_fw); 539 wake_up(&data->wait_fw);
535 return; 540 return;
536 } 541 }
537 if (data->fw_urb == NULL) { 542 if (data->fw_urb == NULL) {
538 dev_err(&udev->dev, "s2255 disconnected\n"); 543 s2255_dev_err(&udev->dev, "disconnected\n");
539 atomic_set(&data->fw_state, S2255_FW_FAILED); 544 atomic_set(&data->fw_state, S2255_FW_FAILED);
540 /* wake up anything waiting for the firmware */ 545 /* wake up anything waiting for the firmware */
541 wake_up(&data->wait_fw); 546 wake_up(&data->wait_fw);
@@ -1278,7 +1283,7 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
1278 } 1283 }
1279 1284
1280 if (!res_get(dev, fh)) { 1285 if (!res_get(dev, fh)) {
1281 dev_err(&dev->udev->dev, "s2255: stream busy\n"); 1286 s2255_dev_err(&dev->udev->dev, "stream busy\n");
1282 return -EBUSY; 1287 return -EBUSY;
1283 } 1288 }
1284 1289
@@ -1545,7 +1550,8 @@ static int s2255_open(struct file *file)
1545 1550
1546 switch (atomic_read(&dev->fw_data->fw_state)) { 1551 switch (atomic_read(&dev->fw_data->fw_state)) {
1547 case S2255_FW_FAILED: 1552 case S2255_FW_FAILED:
1548 err("2255 firmware load failed. retrying.\n"); 1553 s2255_dev_err(&dev->udev->dev,
1554 "firmware load failed. retrying.\n");
1549 s2255_fwload_start(dev, 1); 1555 s2255_fwload_start(dev, 1);
1550 wait_event_timeout(dev->fw_data->wait_fw, 1556 wait_event_timeout(dev->fw_data->wait_fw,
1551 ((atomic_read(&dev->fw_data->fw_state) 1557 ((atomic_read(&dev->fw_data->fw_state)
@@ -2173,7 +2179,8 @@ static int s2255_board_init(struct s2255_dev *dev)
2173 2179
2174 printk(KERN_INFO "2255 usb firmware version %d \n", fw_ver); 2180 printk(KERN_INFO "2255 usb firmware version %d \n", fw_ver);
2175 if (fw_ver < CUR_USB_FWVER) 2181 if (fw_ver < CUR_USB_FWVER)
2176 err("usb firmware not up to date %d\n", fw_ver); 2182 dev_err(&dev->udev->dev,
2183 "usb firmware not up to date %d\n", fw_ver);
2177 2184
2178 for (j = 0; j < MAX_CHANNELS; j++) { 2185 for (j = 0; j < MAX_CHANNELS; j++) {
2179 dev->b_acquire[j] = 0; 2186 dev->b_acquire[j] = 0;
@@ -2228,13 +2235,13 @@ static void read_pipe_completion(struct urb *purb)
2228 dprintk(100, "read pipe completion %p, status %d\n", purb, 2235 dprintk(100, "read pipe completion %p, status %d\n", purb,
2229 purb->status); 2236 purb->status);
2230 if (pipe_info == NULL) { 2237 if (pipe_info == NULL) {
2231 err("no context !"); 2238 dev_err(&purb->dev->dev, "no context!\n");
2232 return; 2239 return;
2233 } 2240 }
2234 2241
2235 dev = pipe_info->dev; 2242 dev = pipe_info->dev;
2236 if (dev == NULL) { 2243 if (dev == NULL) {
2237 err("no context !"); 2244 dev_err(&purb->dev->dev, "no context!\n");
2238 return; 2245 return;
2239 } 2246 }
2240 status = purb->status; 2247 status = purb->status;
@@ -2286,7 +2293,7 @@ static int s2255_start_readpipe(struct s2255_dev *dev)
2286 pipe_info->stream_urb = usb_alloc_urb(0, GFP_KERNEL); 2293 pipe_info->stream_urb = usb_alloc_urb(0, GFP_KERNEL);
2287 if (!pipe_info->stream_urb) { 2294 if (!pipe_info->stream_urb) {
2288 dev_err(&dev->udev->dev, 2295 dev_err(&dev->udev->dev,
2289 "ReadStream: Unable to alloc URB"); 2296 "ReadStream: Unable to alloc URB\n");
2290 return -ENOMEM; 2297 return -ENOMEM;
2291 } 2298 }
2292 /* transfer buffer allocated in board_init */ 2299 /* transfer buffer allocated in board_init */
@@ -2391,7 +2398,7 @@ static void s2255_stop_readpipe(struct s2255_dev *dev)
2391 int j; 2398 int j;
2392 2399
2393 if (dev == NULL) { 2400 if (dev == NULL) {
2394 err("s2255: invalid device"); 2401 s2255_dev_err(&dev->udev->dev, "invalid device\n");
2395 return; 2402 return;
2396 } 2403 }
2397 dprintk(4, "stop read pipe\n"); 2404 dprintk(4, "stop read pipe\n");
@@ -2453,7 +2460,7 @@ static int s2255_probe(struct usb_interface *interface,
2453 /* allocate memory for our device state and initialize it to zero */ 2460 /* allocate memory for our device state and initialize it to zero */
2454 dev = kzalloc(sizeof(struct s2255_dev), GFP_KERNEL); 2461 dev = kzalloc(sizeof(struct s2255_dev), GFP_KERNEL);
2455 if (dev == NULL) { 2462 if (dev == NULL) {
2456 err("s2255: out of memory"); 2463 s2255_dev_err(&interface->dev, "out of memory\n");
2457 goto error; 2464 goto error;
2458 } 2465 }
2459 2466
@@ -2487,7 +2494,7 @@ static int s2255_probe(struct usb_interface *interface,
2487 } 2494 }
2488 2495
2489 if (!dev->read_endpoint) { 2496 if (!dev->read_endpoint) {
2490 dev_err(&interface->dev, "Could not find bulk-in endpoint"); 2497 dev_err(&interface->dev, "Could not find bulk-in endpoint\n");
2491 goto error; 2498 goto error;
2492 } 2499 }
2493 2500
@@ -2583,7 +2590,7 @@ static void s2255_disconnect(struct usb_interface *interface)
2583} 2590}
2584 2591
2585static struct usb_driver s2255_driver = { 2592static struct usb_driver s2255_driver = {
2586 .name = "s2255", 2593 .name = S2255_DRIVER_NAME,
2587 .probe = s2255_probe, 2594 .probe = s2255_probe,
2588 .disconnect = s2255_disconnect, 2595 .disconnect = s2255_disconnect,
2589 .id_table = s2255_table, 2596 .id_table = s2255_table,
@@ -2597,7 +2604,8 @@ static int __init usb_s2255_init(void)
2597 result = usb_register(&s2255_driver); 2604 result = usb_register(&s2255_driver);
2598 2605
2599 if (result) 2606 if (result)
2600 err("usb_register failed. Error number %d", result); 2607 pr_err(KBUILD_MODNAME
2608 ": usb_register failed. Error number %d\n", result);
2601 2609
2602 dprintk(2, "s2255_init: done\n"); 2610 dprintk(2, "s2255_init: done\n");
2603 return result; 2611 return result;
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c
index 9e4f50639975..4444e7e3cdf8 100644
--- a/drivers/media/video/usbvision/usbvision-core.c
+++ b/drivers/media/video/usbvision/usbvision-core.c
@@ -381,8 +381,9 @@ int usbvision_scratch_alloc(struct usb_usbvision *usbvision)
381 usbvision->scratch = vmalloc_32(scratch_buf_size); 381 usbvision->scratch = vmalloc_32(scratch_buf_size);
382 scratch_reset(usbvision); 382 scratch_reset(usbvision);
383 if(usbvision->scratch == NULL) { 383 if(usbvision->scratch == NULL) {
384 err("%s: unable to allocate %d bytes for scratch", 384 dev_err(&usbvision->dev->dev,
385 __func__, scratch_buf_size); 385 "%s: unable to allocate %d bytes for scratch\n",
386 __func__, scratch_buf_size);
386 return -ENOMEM; 387 return -ENOMEM;
387 } 388 }
388 return 0; 389 return 0;
@@ -491,8 +492,9 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision)
491 int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2; 492 int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2;
492 usbvision->IntraFrameBuffer = vmalloc_32(IFB_size); 493 usbvision->IntraFrameBuffer = vmalloc_32(IFB_size);
493 if (usbvision->IntraFrameBuffer == NULL) { 494 if (usbvision->IntraFrameBuffer == NULL) {
494 err("%s: unable to allocate %d for compr. frame buffer", 495 dev_err(&usbvision->dev->dev,
495 __func__, IFB_size); 496 "%s: unable to allocate %d for compr. frame buffer\n",
497 __func__, IFB_size);
496 return -ENOMEM; 498 return -ENOMEM;
497 } 499 }
498 return 0; 500 return 0;
@@ -1514,8 +1516,9 @@ static void usbvision_isocIrq(struct urb *urb)
1514 errCode = usb_submit_urb (urb, GFP_ATOMIC); 1516 errCode = usb_submit_urb (urb, GFP_ATOMIC);
1515 1517
1516 if(errCode) { 1518 if(errCode) {
1517 err("%s: usb_submit_urb failed: error %d", 1519 dev_err(&usbvision->dev->dev,
1518 __func__, errCode); 1520 "%s: usb_submit_urb failed: error %d\n",
1521 __func__, errCode);
1519 } 1522 }
1520 1523
1521 return; 1524 return;
@@ -1546,7 +1549,8 @@ int usbvision_read_reg(struct usb_usbvision *usbvision, unsigned char reg)
1546 0, (__u16) reg, buffer, 1, HZ); 1549 0, (__u16) reg, buffer, 1, HZ);
1547 1550
1548 if (errCode < 0) { 1551 if (errCode < 0) {
1549 err("%s: failed: error %d", __func__, errCode); 1552 dev_err(&usbvision->dev->dev,
1553 "%s: failed: error %d\n", __func__, errCode);
1550 return errCode; 1554 return errCode;
1551 } 1555 }
1552 return buffer[0]; 1556 return buffer[0];
@@ -1574,7 +1578,8 @@ int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg,
1574 USB_RECIP_ENDPOINT, 0, (__u16) reg, &value, 1, HZ); 1578 USB_RECIP_ENDPOINT, 0, (__u16) reg, &value, 1, HZ);
1575 1579
1576 if (errCode < 0) { 1580 if (errCode < 0) {
1577 err("%s: failed: error %d", __func__, errCode); 1581 dev_err(&usbvision->dev->dev,
1582 "%s: failed: error %d\n", __func__, errCode);
1578 } 1583 }
1579 return errCode; 1584 return errCode;
1580} 1585}
@@ -1850,7 +1855,8 @@ int usbvision_set_output(struct usb_usbvision *usbvision, int width,
1850 0, (__u16) USBVISION_LXSIZE_O, value, 4, HZ); 1855 0, (__u16) USBVISION_LXSIZE_O, value, 4, HZ);
1851 1856
1852 if (errCode < 0) { 1857 if (errCode < 0) {
1853 err("%s failed: error %d", __func__, errCode); 1858 dev_err(&usbvision->dev->dev,
1859 "%s failed: error %d\n", __func__, errCode);
1854 return errCode; 1860 return errCode;
1855 } 1861 }
1856 usbvision->curwidth = usbvision->stretch_width * UsbWidth; 1862 usbvision->curwidth = usbvision->stretch_width * UsbWidth;
@@ -2236,7 +2242,7 @@ static int usbvision_set_dram_settings(struct usb_usbvision *usbvision)
2236 (__u16) USBVISION_DRM_PRM1, value, 8, HZ); 2242 (__u16) USBVISION_DRM_PRM1, value, 8, HZ);
2237 2243
2238 if (rc < 0) { 2244 if (rc < 0) {
2239 err("%sERROR=%d", __func__, rc); 2245 dev_err(&usbvision->dev->dev, "%sERROR=%d\n", __func__, rc);
2240 return rc; 2246 return rc;
2241 } 2247 }
2242 2248
@@ -2432,8 +2438,9 @@ int usbvision_set_alternate(struct usb_usbvision *dev)
2432 PDEBUG(DBG_FUNC,"setting alternate %d with wMaxPacketSize=%u", dev->ifaceAlt,dev->isocPacketSize); 2438 PDEBUG(DBG_FUNC,"setting alternate %d with wMaxPacketSize=%u", dev->ifaceAlt,dev->isocPacketSize);
2433 errCode = usb_set_interface(dev->dev, dev->iface, dev->ifaceAlt); 2439 errCode = usb_set_interface(dev->dev, dev->iface, dev->ifaceAlt);
2434 if (errCode < 0) { 2440 if (errCode < 0) {
2435 err ("cannot change alternate number to %d (error=%i)", 2441 dev_err(&dev->dev->dev,
2436 dev->ifaceAlt, errCode); 2442 "cannot change alternate number to %d (error=%i)\n",
2443 dev->ifaceAlt, errCode);
2437 return errCode; 2444 return errCode;
2438 } 2445 }
2439 } 2446 }
@@ -2484,7 +2491,8 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
2484 2491
2485 urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL); 2492 urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
2486 if (urb == NULL) { 2493 if (urb == NULL) {
2487 err("%s: usb_alloc_urb() failed", __func__); 2494 dev_err(&usbvision->dev->dev,
2495 "%s: usb_alloc_urb() failed\n", __func__);
2488 return -ENOMEM; 2496 return -ENOMEM;
2489 } 2497 }
2490 usbvision->sbuf[bufIdx].urb = urb; 2498 usbvision->sbuf[bufIdx].urb = urb;
@@ -2516,8 +2524,9 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision)
2516 errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb, 2524 errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb,
2517 GFP_KERNEL); 2525 GFP_KERNEL);
2518 if (errCode) { 2526 if (errCode) {
2519 err("%s: usb_submit_urb(%d) failed: error %d", 2527 dev_err(&usbvision->dev->dev,
2520 __func__, bufIdx, errCode); 2528 "%s: usb_submit_urb(%d) failed: error %d\n",
2529 __func__, bufIdx, errCode);
2521 } 2530 }
2522 } 2531 }
2523 2532
@@ -2566,8 +2575,9 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)
2566 errCode = usb_set_interface(usbvision->dev, usbvision->iface, 2575 errCode = usb_set_interface(usbvision->dev, usbvision->iface,
2567 usbvision->ifaceAlt); 2576 usbvision->ifaceAlt);
2568 if (errCode < 0) { 2577 if (errCode < 0) {
2569 err("%s: usb_set_interface() failed: error %d", 2578 dev_err(&usbvision->dev->dev,
2570 __func__, errCode); 2579 "%s: usb_set_interface() failed: error %d\n",
2580 __func__, errCode);
2571 usbvision->last_error = errCode; 2581 usbvision->last_error = errCode;
2572 } 2582 }
2573 regValue = (16-usbvision_read_reg(usbvision, USBVISION_ALTER_REG)) & 0x0F; 2583 regValue = (16-usbvision_read_reg(usbvision, USBVISION_ALTER_REG)) & 0x0F;
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
index 6b66ae4f430f..6057098282ca 100644
--- a/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/drivers/media/video/usbvision/usbvision-i2c.c
@@ -119,7 +119,8 @@ static inline int usb_find_address(struct i2c_adapter *i2c_adap,
119 /* try extended address code... */ 119 /* try extended address code... */
120 ret = try_write_address(i2c_adap, addr, retries); 120 ret = try_write_address(i2c_adap, addr, retries);
121 if (ret != 1) { 121 if (ret != 1) {
122 err("died at extended address code, while writing"); 122 dev_err(&i2c_adap->dev,
123 "died at extended address code, while writing\n");
123 return -EREMOTEIO; 124 return -EREMOTEIO;
124 } 125 }
125 add[0] = addr; 126 add[0] = addr;
@@ -128,7 +129,8 @@ static inline int usb_find_address(struct i2c_adapter *i2c_adap,
128 addr |= 0x01; 129 addr |= 0x01;
129 ret = try_read_address(i2c_adap, addr, retries); 130 ret = try_read_address(i2c_adap, addr, retries);
130 if (ret != 1) { 131 if (ret != 1) {
131 err("died at extended address code, while reading"); 132 dev_err(&i2c_adap->dev,
133 "died at extended address code, while reading\n");
132 return -EREMOTEIO; 134 return -EREMOTEIO;
133 } 135 }
134 } 136 }
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 2622de003a45..47d672da5415 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -329,7 +329,7 @@ static void usbvision_create_sysfs(struct video_device *vdev)
329 return; 329 return;
330 } while (0); 330 } while (0);
331 331
332 err("%s error: %d\n", __func__, res); 332 dev_err(&vdev->dev, "%s error: %d\n", __func__, res);
333} 333}
334 334
335static void usbvision_remove_sysfs(struct video_device *vdev) 335static void usbvision_remove_sysfs(struct video_device *vdev)
@@ -487,8 +487,9 @@ static int vidioc_g_register (struct file *file, void *priv,
487 /* NT100x has a 8-bit register space */ 487 /* NT100x has a 8-bit register space */
488 errCode = usbvision_read_reg(usbvision, reg->reg&0xff); 488 errCode = usbvision_read_reg(usbvision, reg->reg&0xff);
489 if (errCode < 0) { 489 if (errCode < 0) {
490 err("%s: VIDIOC_DBG_G_REGISTER failed: error %d", 490 dev_err(&usbvision->vdev->dev,
491 __func__, errCode); 491 "%s: VIDIOC_DBG_G_REGISTER failed: error %d\n",
492 __func__, errCode);
492 return errCode; 493 return errCode;
493 } 494 }
494 reg->val = errCode; 495 reg->val = errCode;
@@ -507,8 +508,9 @@ static int vidioc_s_register (struct file *file, void *priv,
507 /* NT100x has a 8-bit register space */ 508 /* NT100x has a 8-bit register space */
508 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); 509 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val);
509 if (errCode < 0) { 510 if (errCode < 0) {
510 err("%s: VIDIOC_DBG_S_REGISTER failed: error %d", 511 dev_err(&usbvision->vdev->dev,
511 __func__, errCode); 512 "%s: VIDIOC_DBG_S_REGISTER failed: error %d\n",
513 __func__, errCode);
512 return errCode; 514 return errCode;
513 } 515 }
514 return 0; 516 return 0;
@@ -1189,7 +1191,9 @@ static int usbvision_radio_open(struct file *file)
1189 mutex_lock(&usbvision->lock); 1191 mutex_lock(&usbvision->lock);
1190 1192
1191 if (usbvision->user) { 1193 if (usbvision->user) {
1192 err("%s: Someone tried to open an already opened USBVision Radio!", __func__); 1194 dev_err(&usbvision->rdev->dev,
1195 "%s: Someone tried to open an already opened USBVision Radio!\n",
1196 __func__);
1193 errCode = -EBUSY; 1197 errCode = -EBUSY;
1194 } 1198 }
1195 else { 1199 else {
@@ -1413,7 +1417,8 @@ static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision,
1413 struct video_device *vdev; 1417 struct video_device *vdev;
1414 1418
1415 if (usb_dev == NULL) { 1419 if (usb_dev == NULL) {
1416 err("%s: usbvision->dev is not set", __func__); 1420 dev_err(&usbvision->dev->dev,
1421 "%s: usbvision->dev is not set\n", __func__);
1417 return NULL; 1422 return NULL;
1418 } 1423 }
1419 1424
@@ -1524,7 +1529,9 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
1524 return 0; 1529 return 0;
1525 1530
1526 err_exit: 1531 err_exit:
1527 err("USBVision[%d]: video_register_device() failed", usbvision->nr); 1532 dev_err(&usbvision->dev->dev,
1533 "USBVision[%d]: video_register_device() failed\n",
1534 usbvision->nr);
1528 usbvision_unregister_video(usbvision); 1535 usbvision_unregister_video(usbvision);
1529 return -1; 1536 return -1;
1530} 1537}
@@ -1675,20 +1682,20 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
1675 } 1682 }
1676 endpoint = &interface->endpoint[1].desc; 1683 endpoint = &interface->endpoint[1].desc;
1677 if (!usb_endpoint_xfer_isoc(endpoint)) { 1684 if (!usb_endpoint_xfer_isoc(endpoint)) {
1678 err("%s: interface %d. has non-ISO endpoint!", 1685 dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
1679 __func__, ifnum); 1686 __func__, ifnum);
1680 err("%s: Endpoint attributes %d", 1687 dev_err(&intf->dev, "%s: Endpoint attributes %d",
1681 __func__, endpoint->bmAttributes); 1688 __func__, endpoint->bmAttributes);
1682 return -ENODEV; 1689 return -ENODEV;
1683 } 1690 }
1684 if (usb_endpoint_dir_out(endpoint)) { 1691 if (usb_endpoint_dir_out(endpoint)) {
1685 err("%s: interface %d. has ISO OUT endpoint!", 1692 dev_err(&intf->dev, "%s: interface %d. has ISO OUT endpoint!\n",
1686 __func__, ifnum); 1693 __func__, ifnum);
1687 return -ENODEV; 1694 return -ENODEV;
1688 } 1695 }
1689 1696
1690 if ((usbvision = usbvision_alloc(dev)) == NULL) { 1697 if ((usbvision = usbvision_alloc(dev)) == NULL) {
1691 err("%s: couldn't allocate USBVision struct", __func__); 1698 dev_err(&intf->dev, "%s: couldn't allocate USBVision struct\n", __func__);
1692 return -ENOMEM; 1699 return -ENOMEM;
1693 } 1700 }
1694 1701
@@ -1711,7 +1718,7 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
1711 usbvision->alt_max_pkt_size = kmalloc(32* 1718 usbvision->alt_max_pkt_size = kmalloc(32*
1712 usbvision->num_alt,GFP_KERNEL); 1719 usbvision->num_alt,GFP_KERNEL);
1713 if (usbvision->alt_max_pkt_size == NULL) { 1720 if (usbvision->alt_max_pkt_size == NULL) {
1714 err("usbvision: out of memory!\n"); 1721 dev_err(&intf->dev, "usbvision: out of memory!\n");
1715 mutex_unlock(&usbvision->lock); 1722 mutex_unlock(&usbvision->lock);
1716 return -ENOMEM; 1723 return -ENOMEM;
1717 } 1724 }
@@ -1772,7 +1779,8 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
1772 PDEBUG(DBG_PROBE, ""); 1779 PDEBUG(DBG_PROBE, "");
1773 1780
1774 if (usbvision == NULL) { 1781 if (usbvision == NULL) {
1775 err("%s: usb_get_intfdata() failed", __func__); 1782 dev_err(&usbvision->dev->dev,
1783 "%s: usb_get_intfdata() failed\n", __func__);
1776 return; 1784 return;
1777 } 1785 }
1778 usb_set_intfdata (intf, NULL); 1786 usb_set_intfdata (intf, NULL);