aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-417.c28
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-audio.c56
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-avcore.c126
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-cards.c71
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-core.c52
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-dvb.c65
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-i2c.c10
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-input.c4
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c20
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-vbi.c26
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c44
-rw-r--r--drivers/media/usb/cx231xx/cx231xx.h1
12 files changed, 252 insertions, 251 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c
index 0773da4dc29b..8998fa4a43f6 100644
--- a/drivers/media/usb/cx231xx/cx231xx-417.c
+++ b/drivers/media/usb/cx231xx/cx231xx-417.c
@@ -987,25 +987,25 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
987 IVTV_REG_APU, 0); 987 IVTV_REG_APU, 0);
988 988
989 if (retval != 0) { 989 if (retval != 0) {
990 dev_err(&dev->udev->dev, 990 dev_err(dev->dev,
991 "%s: Error with mc417_register_write\n", __func__); 991 "%s: Error with mc417_register_write\n", __func__);
992 return -1; 992 return -1;
993 } 993 }
994 994
995 retval = request_firmware(&firmware, CX231xx_FIRM_IMAGE_NAME, 995 retval = request_firmware(&firmware, CX231xx_FIRM_IMAGE_NAME,
996 &dev->udev->dev); 996 dev->dev);
997 997
998 if (retval != 0) { 998 if (retval != 0) {
999 dev_err(&dev->udev->dev, 999 dev_err(dev->dev,
1000 "ERROR: Hotplug firmware request failed (%s).\n", 1000 "ERROR: Hotplug firmware request failed (%s).\n",
1001 CX231xx_FIRM_IMAGE_NAME); 1001 CX231xx_FIRM_IMAGE_NAME);
1002 dev_err(&dev->udev->dev, 1002 dev_err(dev->dev,
1003 "Please fix your hotplug setup, the board will not work without firmware loaded!\n"); 1003 "Please fix your hotplug setup, the board will not work without firmware loaded!\n");
1004 return -1; 1004 return -1;
1005 } 1005 }
1006 1006
1007 if (firmware->size != CX231xx_FIRM_IMAGE_SIZE) { 1007 if (firmware->size != CX231xx_FIRM_IMAGE_SIZE) {
1008 dev_err(&dev->udev->dev, 1008 dev_err(dev->dev,
1009 "ERROR: Firmware size mismatch (have %zd, expected %d)\n", 1009 "ERROR: Firmware size mismatch (have %zd, expected %d)\n",
1010 firmware->size, CX231xx_FIRM_IMAGE_SIZE); 1010 firmware->size, CX231xx_FIRM_IMAGE_SIZE);
1011 release_firmware(firmware); 1011 release_firmware(firmware);
@@ -1013,7 +1013,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
1013 } 1013 }
1014 1014
1015 if (0 != memcmp(firmware->data, magic, 8)) { 1015 if (0 != memcmp(firmware->data, magic, 8)) {
1016 dev_err(&dev->udev->dev, 1016 dev_err(dev->dev,
1017 "ERROR: Firmware magic mismatch, wrong file?\n"); 1017 "ERROR: Firmware magic mismatch, wrong file?\n");
1018 release_firmware(firmware); 1018 release_firmware(firmware);
1019 return -1; 1019 return -1;
@@ -1061,7 +1061,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
1061 retval |= mc417_register_write(dev, IVTV_REG_HW_BLOCKS, 1061 retval |= mc417_register_write(dev, IVTV_REG_HW_BLOCKS,
1062 IVTV_CMD_HW_BLOCKS_RST); 1062 IVTV_CMD_HW_BLOCKS_RST);
1063 if (retval < 0) { 1063 if (retval < 0) {
1064 dev_err(&dev->udev->dev, 1064 dev_err(dev->dev,
1065 "%s: Error with mc417_register_write\n", 1065 "%s: Error with mc417_register_write\n",
1066 __func__); 1066 __func__);
1067 return retval; 1067 return retval;
@@ -1074,7 +1074,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
1074 retval |= mc417_register_write(dev, IVTV_REG_VPU, value & 0xFFFFFFE8); 1074 retval |= mc417_register_write(dev, IVTV_REG_VPU, value & 0xFFFFFFE8);
1075 1075
1076 if (retval < 0) { 1076 if (retval < 0) {
1077 dev_err(&dev->udev->dev, 1077 dev_err(dev->dev,
1078 "%s: Error with mc417_register_write\n", 1078 "%s: Error with mc417_register_write\n",
1079 __func__); 1079 __func__);
1080 return retval; 1080 return retval;
@@ -1123,27 +1123,27 @@ static int cx231xx_initialize_codec(struct cx231xx *dev)
1123 dprintk(2, "%s: PING OK\n", __func__); 1123 dprintk(2, "%s: PING OK\n", __func__);
1124 retval = cx231xx_load_firmware(dev); 1124 retval = cx231xx_load_firmware(dev);
1125 if (retval < 0) { 1125 if (retval < 0) {
1126 dev_err(&dev->udev->dev, 1126 dev_err(dev->dev,
1127 "%s: f/w load failed\n", __func__); 1127 "%s: f/w load failed\n", __func__);
1128 return retval; 1128 return retval;
1129 } 1129 }
1130 retval = cx231xx_find_mailbox(dev); 1130 retval = cx231xx_find_mailbox(dev);
1131 if (retval < 0) { 1131 if (retval < 0) {
1132 dev_err(&dev->udev->dev, "%s: mailbox < 0, error\n", 1132 dev_err(dev->dev, "%s: mailbox < 0, error\n",
1133 __func__); 1133 __func__);
1134 return -1; 1134 return -1;
1135 } 1135 }
1136 dev->cx23417_mailbox = retval; 1136 dev->cx23417_mailbox = retval;
1137 retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); 1137 retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0);
1138 if (retval < 0) { 1138 if (retval < 0) {
1139 dev_err(&dev->udev->dev, 1139 dev_err(dev->dev,
1140 "ERROR: cx23417 firmware ping failed!\n"); 1140 "ERROR: cx23417 firmware ping failed!\n");
1141 return -1; 1141 return -1;
1142 } 1142 }
1143 retval = cx231xx_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1, 1143 retval = cx231xx_api_cmd(dev, CX2341X_ENC_GET_VERSION, 0, 1,
1144 &version); 1144 &version);
1145 if (retval < 0) { 1145 if (retval < 0) {
1146 dev_err(&dev->udev->dev, 1146 dev_err(dev->dev,
1147 "ERROR: cx23417 firmware get encoder: version failed!\n"); 1147 "ERROR: cx23417 firmware get encoder: version failed!\n");
1148 return -1; 1148 return -1;
1149 } 1149 }
@@ -1425,7 +1425,7 @@ static int bb_buf_prepare(struct videobuf_queue *q,
1425 if (!dev->video_mode.bulk_ctl.num_bufs) 1425 if (!dev->video_mode.bulk_ctl.num_bufs)
1426 urb_init = 1; 1426 urb_init = 1;
1427 } 1427 }
1428 dev_dbg(&dev->udev->dev, 1428 dev_dbg(dev->dev,
1429 "urb_init=%d dev->video_mode.max_pkt_size=%d\n", 1429 "urb_init=%d dev->video_mode.max_pkt_size=%d\n",
1430 urb_init, dev->video_mode.max_pkt_size); 1430 urb_init, dev->video_mode.max_pkt_size);
1431 dev->mode_tv = 1; 1431 dev->mode_tv = 1;
@@ -1698,7 +1698,7 @@ static int mpeg_open(struct file *file)
1698 sizeof(struct cx231xx_buffer), fh, &dev->lock); 1698 sizeof(struct cx231xx_buffer), fh, &dev->lock);
1699/* 1699/*
1700 videobuf_queue_sg_init(&fh->vidq, &cx231xx_qops, 1700 videobuf_queue_sg_init(&fh->vidq, &cx231xx_qops,
1701 &dev->udev->dev, &dev->ts1.slock, 1701 dev->dev, &dev->ts1.slock,
1702 V4L2_BUF_TYPE_VIDEO_CAPTURE, 1702 V4L2_BUF_TYPE_VIDEO_CAPTURE,
1703 V4L2_FIELD_INTERLACED, 1703 V4L2_FIELD_INTERLACED,
1704 sizeof(struct cx231xx_buffer), 1704 sizeof(struct cx231xx_buffer),
diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c
index a05ae02e5245..6d9a03402faf 100644
--- a/drivers/media/usb/cx231xx/cx231xx-audio.c
+++ b/drivers/media/usb/cx231xx/cx231xx-audio.c
@@ -48,7 +48,7 @@ static int cx231xx_isoc_audio_deinit(struct cx231xx *dev)
48{ 48{
49 int i; 49 int i;
50 50
51 dev_dbg(&dev->udev->dev, "Stopping isoc\n"); 51 dev_dbg(dev->dev, "Stopping isoc\n");
52 52
53 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) { 53 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
54 if (dev->adev.urb[i]) { 54 if (dev->adev.urb[i]) {
@@ -72,7 +72,7 @@ static int cx231xx_bulk_audio_deinit(struct cx231xx *dev)
72{ 72{
73 int i; 73 int i;
74 74
75 dev_dbg(&dev->udev->dev, "Stopping bulk\n"); 75 dev_dbg(dev->dev, "Stopping bulk\n");
76 76
77 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) { 77 for (i = 0; i < CX231XX_AUDIO_BUFS; i++) {
78 if (dev->adev.urb[i]) { 78 if (dev->adev.urb[i]) {
@@ -116,7 +116,7 @@ static void cx231xx_audio_isocirq(struct urb *urb)
116 case -ESHUTDOWN: 116 case -ESHUTDOWN:
117 return; 117 return;
118 default: /* error */ 118 default: /* error */
119 dev_dbg(&dev->udev->dev, "urb completition error %d.\n", 119 dev_dbg(dev->dev, "urb completition error %d.\n",
120 urb->status); 120 urb->status);
121 break; 121 break;
122 } 122 }
@@ -176,7 +176,7 @@ static void cx231xx_audio_isocirq(struct urb *urb)
176 176
177 status = usb_submit_urb(urb, GFP_ATOMIC); 177 status = usb_submit_urb(urb, GFP_ATOMIC);
178 if (status < 0) { 178 if (status < 0) {
179 dev_err(&dev->udev->dev, 179 dev_err(dev->dev,
180 "resubmit of audio urb failed (error=%i)\n", 180 "resubmit of audio urb failed (error=%i)\n",
181 status); 181 status);
182 } 182 }
@@ -206,7 +206,7 @@ static void cx231xx_audio_bulkirq(struct urb *urb)
206 case -ESHUTDOWN: 206 case -ESHUTDOWN:
207 return; 207 return;
208 default: /* error */ 208 default: /* error */
209 dev_dbg(&dev->udev->dev, "urb completition error %d.\n", 209 dev_dbg(dev->dev, "urb completition error %d.\n",
210 urb->status); 210 urb->status);
211 break; 211 break;
212 } 212 }
@@ -262,7 +262,7 @@ static void cx231xx_audio_bulkirq(struct urb *urb)
262 262
263 status = usb_submit_urb(urb, GFP_ATOMIC); 263 status = usb_submit_urb(urb, GFP_ATOMIC);
264 if (status < 0) { 264 if (status < 0) {
265 dev_err(&dev->udev->dev, 265 dev_err(dev->dev,
266 "resubmit of audio urb failed (error=%i)\n", 266 "resubmit of audio urb failed (error=%i)\n",
267 status); 267 status);
268 } 268 }
@@ -274,7 +274,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev)
274 int i, errCode; 274 int i, errCode;
275 int sb_size; 275 int sb_size;
276 276
277 dev_dbg(&dev->udev->dev, 277 dev_dbg(dev->dev,
278 "%s: Starting ISO AUDIO transfers\n", __func__); 278 "%s: Starting ISO AUDIO transfers\n", __func__);
279 279
280 if (dev->state & DEV_DISCONNECTED) 280 if (dev->state & DEV_DISCONNECTED)
@@ -293,7 +293,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev)
293 memset(dev->adev.transfer_buffer[i], 0x80, sb_size); 293 memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
294 urb = usb_alloc_urb(CX231XX_ISO_NUM_AUDIO_PACKETS, GFP_ATOMIC); 294 urb = usb_alloc_urb(CX231XX_ISO_NUM_AUDIO_PACKETS, GFP_ATOMIC);
295 if (!urb) { 295 if (!urb) {
296 dev_err(&dev->udev->dev, "usb_alloc_urb failed!\n"); 296 dev_err(dev->dev, "usb_alloc_urb failed!\n");
297 for (j = 0; j < i; j++) { 297 for (j = 0; j < i; j++) {
298 usb_free_urb(dev->adev.urb[j]); 298 usb_free_urb(dev->adev.urb[j]);
299 kfree(dev->adev.transfer_buffer[j]); 299 kfree(dev->adev.transfer_buffer[j]);
@@ -336,7 +336,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
336 int i, errCode; 336 int i, errCode;
337 int sb_size; 337 int sb_size;
338 338
339 dev_dbg(&dev->udev->dev, 339 dev_dbg(dev->dev,
340 "%s: Starting BULK AUDIO transfers\n", __func__); 340 "%s: Starting BULK AUDIO transfers\n", __func__);
341 341
342 if (dev->state & DEV_DISCONNECTED) 342 if (dev->state & DEV_DISCONNECTED)
@@ -355,7 +355,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
355 memset(dev->adev.transfer_buffer[i], 0x80, sb_size); 355 memset(dev->adev.transfer_buffer[i], 0x80, sb_size);
356 urb = usb_alloc_urb(CX231XX_NUM_AUDIO_PACKETS, GFP_ATOMIC); 356 urb = usb_alloc_urb(CX231XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
357 if (!urb) { 357 if (!urb) {
358 dev_err(&dev->udev->dev, "usb_alloc_urb failed!\n"); 358 dev_err(dev->dev, "usb_alloc_urb failed!\n");
359 for (j = 0; j < i; j++) { 359 for (j = 0; j < i; j++) {
360 usb_free_urb(dev->adev.urb[j]); 360 usb_free_urb(dev->adev.urb[j]);
361 kfree(dev->adev.transfer_buffer[j]); 361 kfree(dev->adev.transfer_buffer[j]);
@@ -393,7 +393,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
393 struct snd_pcm_runtime *runtime = subs->runtime; 393 struct snd_pcm_runtime *runtime = subs->runtime;
394 struct cx231xx *dev = snd_pcm_substream_chip(subs); 394 struct cx231xx *dev = snd_pcm_substream_chip(subs);
395 395
396 dev_dbg(&dev->udev->dev, "Allocating vbuffer\n"); 396 dev_dbg(dev->dev, "Allocating vbuffer\n");
397 if (runtime->dma_area) { 397 if (runtime->dma_area) {
398 if (runtime->dma_bytes > size) 398 if (runtime->dma_bytes > size)
399 return 0; 399 return 0;
@@ -436,17 +436,17 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
436 struct snd_pcm_runtime *runtime = substream->runtime; 436 struct snd_pcm_runtime *runtime = substream->runtime;
437 int ret = 0; 437 int ret = 0;
438 438
439 dev_dbg(&dev->udev->dev, 439 dev_dbg(dev->dev,
440 "opening device and trying to acquire exclusive lock\n"); 440 "opening device and trying to acquire exclusive lock\n");
441 441
442 if (!dev) { 442 if (!dev) {
443 dev_err(&dev->udev->dev, 443 dev_err(dev->dev,
444 "BUG: cx231xx can't find device struct. Can't proceed with open\n"); 444 "BUG: cx231xx can't find device struct. Can't proceed with open\n");
445 return -ENODEV; 445 return -ENODEV;
446 } 446 }
447 447
448 if (dev->state & DEV_DISCONNECTED) { 448 if (dev->state & DEV_DISCONNECTED) {
449 dev_err(&dev->udev->dev, 449 dev_err(dev->dev,
450 "Can't open. the device was removed.\n"); 450 "Can't open. the device was removed.\n");
451 return -ENODEV; 451 return -ENODEV;
452 } 452 }
@@ -460,7 +460,7 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
460 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0); 460 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
461 mutex_unlock(&dev->lock); 461 mutex_unlock(&dev->lock);
462 if (ret < 0) { 462 if (ret < 0) {
463 dev_err(&dev->udev->dev, 463 dev_err(dev->dev,
464 "failed to set alternate setting !\n"); 464 "failed to set alternate setting !\n");
465 465
466 return ret; 466 return ret;
@@ -487,7 +487,7 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
487 int ret; 487 int ret;
488 struct cx231xx *dev = snd_pcm_substream_chip(substream); 488 struct cx231xx *dev = snd_pcm_substream_chip(substream);
489 489
490 dev_dbg(&dev->udev->dev, "closing device\n"); 490 dev_dbg(dev->dev, "closing device\n");
491 491
492 /* inform hardware to stop streaming */ 492 /* inform hardware to stop streaming */
493 mutex_lock(&dev->lock); 493 mutex_lock(&dev->lock);
@@ -497,7 +497,7 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
497 /* 1 - 48000 samples per sec */ 497 /* 1 - 48000 samples per sec */
498 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0); 498 ret = cx231xx_set_alt_setting(dev, INDEX_AUDIO, 0);
499 if (ret < 0) { 499 if (ret < 0) {
500 dev_err(&dev->udev->dev, 500 dev_err(dev->dev,
501 "failed to set alternate setting !\n"); 501 "failed to set alternate setting !\n");
502 502
503 mutex_unlock(&dev->lock); 503 mutex_unlock(&dev->lock);
@@ -508,10 +508,10 @@ static int snd_cx231xx_pcm_close(struct snd_pcm_substream *substream)
508 mutex_unlock(&dev->lock); 508 mutex_unlock(&dev->lock);
509 509
510 if (dev->adev.users == 0 && dev->adev.shutdown == 1) { 510 if (dev->adev.users == 0 && dev->adev.shutdown == 1) {
511 dev_dbg(&dev->udev->dev, "audio users: %d\n", dev->adev.users); 511 dev_dbg(dev->dev, "audio users: %d\n", dev->adev.users);
512 dev_dbg(&dev->udev->dev, "disabling audio stream!\n"); 512 dev_dbg(dev->dev, "disabling audio stream!\n");
513 dev->adev.shutdown = 0; 513 dev->adev.shutdown = 0;
514 dev_dbg(&dev->udev->dev, "released lock\n"); 514 dev_dbg(dev->dev, "released lock\n");
515 if (atomic_read(&dev->stream_started) > 0) { 515 if (atomic_read(&dev->stream_started) > 0) {
516 atomic_set(&dev->stream_started, 0); 516 atomic_set(&dev->stream_started, 0);
517 schedule_work(&dev->wq_trigger); 517 schedule_work(&dev->wq_trigger);
@@ -526,7 +526,7 @@ static int snd_cx231xx_hw_capture_params(struct snd_pcm_substream *substream,
526 struct cx231xx *dev = snd_pcm_substream_chip(substream); 526 struct cx231xx *dev = snd_pcm_substream_chip(substream);
527 int ret; 527 int ret;
528 528
529 dev_dbg(&dev->udev->dev, "Setting capture parameters\n"); 529 dev_dbg(dev->dev, "Setting capture parameters\n");
530 530
531 ret = snd_pcm_alloc_vmalloc_buffer(substream, 531 ret = snd_pcm_alloc_vmalloc_buffer(substream,
532 params_buffer_bytes(hw_params)); 532 params_buffer_bytes(hw_params));
@@ -548,7 +548,7 @@ static int snd_cx231xx_hw_capture_free(struct snd_pcm_substream *substream)
548{ 548{
549 struct cx231xx *dev = snd_pcm_substream_chip(substream); 549 struct cx231xx *dev = snd_pcm_substream_chip(substream);
550 550
551 dev_dbg(&dev->udev->dev, "Stop capture, if needed\n"); 551 dev_dbg(dev->dev, "Stop capture, if needed\n");
552 552
553 if (atomic_read(&dev->stream_started) > 0) { 553 if (atomic_read(&dev->stream_started) > 0) {
554 atomic_set(&dev->stream_started, 0); 554 atomic_set(&dev->stream_started, 0);
@@ -573,7 +573,7 @@ static void audio_trigger(struct work_struct *work)
573 struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger); 573 struct cx231xx *dev = container_of(work, struct cx231xx, wq_trigger);
574 574
575 if (atomic_read(&dev->stream_started)) { 575 if (atomic_read(&dev->stream_started)) {
576 dev_dbg(&dev->udev->dev, "starting capture"); 576 dev_dbg(dev->dev, "starting capture");
577 if (is_fw_load(dev) == 0) 577 if (is_fw_load(dev) == 0)
578 cx25840_call(dev, core, load_fw); 578 cx25840_call(dev, core, load_fw);
579 if (dev->USE_ISO) 579 if (dev->USE_ISO)
@@ -581,7 +581,7 @@ static void audio_trigger(struct work_struct *work)
581 else 581 else
582 cx231xx_init_audio_bulk(dev); 582 cx231xx_init_audio_bulk(dev);
583 } else { 583 } else {
584 dev_dbg(&dev->udev->dev, "stopping capture"); 584 dev_dbg(dev->dev, "stopping capture");
585 cx231xx_isoc_audio_deinit(dev); 585 cx231xx_isoc_audio_deinit(dev);
586 } 586 }
587} 587}
@@ -667,10 +667,10 @@ static int cx231xx_audio_init(struct cx231xx *dev)
667 return 0; 667 return 0;
668 } 668 }
669 669
670 dev_dbg(&dev->udev->dev, 670 dev_dbg(dev->dev,
671 "probing for cx231xx non standard usbaudio\n"); 671 "probing for cx231xx non standard usbaudio\n");
672 672
673 err = snd_card_new(&dev->udev->dev, index[devnr], "Cx231xx Audio", 673 err = snd_card_new(dev->dev, index[devnr], "Cx231xx Audio",
674 THIS_MODULE, 0, &card); 674 THIS_MODULE, 0, &card);
675 if (err < 0) 675 if (err < 0)
676 return err; 676 return err;
@@ -712,7 +712,7 @@ static int cx231xx_audio_init(struct cx231xx *dev)
712 bEndpointAddress; 712 bEndpointAddress;
713 713
714 adev->num_alt = uif->num_altsetting; 714 adev->num_alt = uif->num_altsetting;
715 dev_info(&dev->udev->dev, 715 dev_info(dev->dev,
716 "audio EndPoint Addr 0x%x, Alternate settings: %i\n", 716 "audio EndPoint Addr 0x%x, Alternate settings: %i\n",
717 adev->end_point_addr, adev->num_alt); 717 adev->end_point_addr, adev->num_alt);
718 adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL); 718 adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL);
@@ -726,7 +726,7 @@ static int cx231xx_audio_init(struct cx231xx *dev)
726 wMaxPacketSize); 726 wMaxPacketSize);
727 adev->alt_max_pkt_size[i] = 727 adev->alt_max_pkt_size[i] =
728 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); 728 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
729 dev_dbg(&dev->udev->dev, 729 dev_dbg(dev->dev,
730 "audio alternate setting %i, max size= %i\n", i, 730 "audio alternate setting %i, max size= %i\n", i,
731 adev->alt_max_pkt_size[i]); 731 adev->alt_max_pkt_size[i]);
732 } 732 }
diff --git a/drivers/media/usb/cx231xx/cx231xx-avcore.c b/drivers/media/usb/cx231xx/cx231xx-avcore.c
index b299242a63dd..39e887925e3d 100644
--- a/drivers/media/usb/cx231xx/cx231xx-avcore.c
+++ b/drivers/media/usb/cx231xx/cx231xx-avcore.c
@@ -82,10 +82,10 @@ void initGPIO(struct cx231xx *dev)
82 cx231xx_send_gpio_cmd(dev, _gpio_direction, (u8 *)&value, 4, 0, 0); 82 cx231xx_send_gpio_cmd(dev, _gpio_direction, (u8 *)&value, 4, 0, 0);
83 83
84 verve_read_byte(dev, 0x07, &val); 84 verve_read_byte(dev, 0x07, &val);
85 dev_dbg(&dev->udev->dev, "verve_read_byte address0x07=0x%x\n", val); 85 dev_dbg(dev->dev, "verve_read_byte address0x07=0x%x\n", val);
86 verve_write_byte(dev, 0x07, 0xF4); 86 verve_write_byte(dev, 0x07, 0xF4);
87 verve_read_byte(dev, 0x07, &val); 87 verve_read_byte(dev, 0x07, &val);
88 dev_dbg(&dev->udev->dev, "verve_read_byte address0x07=0x%x\n", val); 88 dev_dbg(dev->dev, "verve_read_byte address0x07=0x%x\n", val);
89 89
90 cx231xx_capture_start(dev, 1, Vbi); 90 cx231xx_capture_start(dev, 1, Vbi);
91 91
@@ -155,7 +155,7 @@ int cx231xx_afe_init_super_block(struct cx231xx *dev, u32 ref_count)
155 while (afe_power_status != 0x18) { 155 while (afe_power_status != 0x18) {
156 status = afe_write_byte(dev, SUP_BLK_PWRDN, 0x18); 156 status = afe_write_byte(dev, SUP_BLK_PWRDN, 0x18);
157 if (status < 0) { 157 if (status < 0) {
158 dev_dbg(&dev->udev->dev, 158 dev_dbg(dev->dev,
159 "%s: Init Super Block failed in send cmd\n", 159 "%s: Init Super Block failed in send cmd\n",
160 __func__); 160 __func__);
161 break; 161 break;
@@ -164,14 +164,14 @@ int cx231xx_afe_init_super_block(struct cx231xx *dev, u32 ref_count)
164 status = afe_read_byte(dev, SUP_BLK_PWRDN, &afe_power_status); 164 status = afe_read_byte(dev, SUP_BLK_PWRDN, &afe_power_status);
165 afe_power_status &= 0xff; 165 afe_power_status &= 0xff;
166 if (status < 0) { 166 if (status < 0) {
167 dev_dbg(&dev->udev->dev, 167 dev_dbg(dev->dev,
168 "%s: Init Super Block failed in receive cmd\n", 168 "%s: Init Super Block failed in receive cmd\n",
169 __func__); 169 __func__);
170 break; 170 break;
171 } 171 }
172 i++; 172 i++;
173 if (i == 10) { 173 if (i == 10) {
174 dev_dbg(&dev->udev->dev, 174 dev_dbg(dev->dev,
175 "%s: Init Super Block force break in loop !!!!\n", 175 "%s: Init Super Block force break in loop !!!!\n",
176 __func__); 176 __func__);
177 status = -1; 177 status = -1;
@@ -412,7 +412,7 @@ int cx231xx_afe_update_power_control(struct cx231xx *dev,
412 status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3, 412 status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
413 0x00); 413 0x00);
414 } else { 414 } else {
415 dev_dbg(&dev->udev->dev, "Invalid AV mode input\n"); 415 dev_dbg(dev->dev, "Invalid AV mode input\n");
416 status = -1; 416 status = -1;
417 } 417 }
418 break; 418 break;
@@ -469,7 +469,7 @@ int cx231xx_afe_update_power_control(struct cx231xx *dev,
469 status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3, 469 status |= afe_write_byte(dev, ADC_PWRDN_CLAMP_CH3,
470 0x40); 470 0x40);
471 } else { 471 } else {
472 dev_dbg(&dev->udev->dev, "Invalid AV mode input\n"); 472 dev_dbg(dev->dev, "Invalid AV mode input\n");
473 status = -1; 473 status = -1;
474 } 474 }
475 } /* switch */ 475 } /* switch */
@@ -575,7 +575,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)
575 status = cx231xx_set_power_mode(dev, 575 status = cx231xx_set_power_mode(dev,
576 POLARIS_AVMODE_ENXTERNAL_AV); 576 POLARIS_AVMODE_ENXTERNAL_AV);
577 if (status < 0) { 577 if (status < 0) {
578 dev_err(&dev->udev->dev, 578 dev_err(dev->dev,
579 "%s: Failed to set Power - errCode [%d]!\n", 579 "%s: Failed to set Power - errCode [%d]!\n",
580 __func__, status); 580 __func__, status);
581 return status; 581 return status;
@@ -593,7 +593,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)
593 status = cx231xx_set_power_mode(dev, 593 status = cx231xx_set_power_mode(dev,
594 POLARIS_AVMODE_ANALOGT_TV); 594 POLARIS_AVMODE_ANALOGT_TV);
595 if (status < 0) { 595 if (status < 0) {
596 dev_err(&dev->udev->dev, 596 dev_err(dev->dev,
597 "%s: Failed to set Power - errCode [%d]!\n", 597 "%s: Failed to set Power - errCode [%d]!\n",
598 __func__, status); 598 __func__, status);
599 return status; 599 return status;
@@ -610,7 +610,7 @@ int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input)
610 610
611 break; 611 break;
612 default: 612 default:
613 dev_err(&dev->udev->dev, "%s: Unknown Input %d !\n", 613 dev_err(dev->dev, "%s: Unknown Input %d !\n",
614 __func__, INPUT(input)->type); 614 __func__, INPUT(input)->type);
615 break; 615 break;
616 } 616 }
@@ -630,7 +630,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
630 if (pin_type != dev->video_input) { 630 if (pin_type != dev->video_input) {
631 status = cx231xx_afe_adjust_ref_count(dev, pin_type); 631 status = cx231xx_afe_adjust_ref_count(dev, pin_type);
632 if (status < 0) { 632 if (status < 0) {
633 dev_err(&dev->udev->dev, 633 dev_err(dev->dev,
634 "%s: adjust_ref_count :Failed to set AFE input mux - errCode [%d]!\n", 634 "%s: adjust_ref_count :Failed to set AFE input mux - errCode [%d]!\n",
635 __func__, status); 635 __func__, status);
636 return status; 636 return status;
@@ -640,7 +640,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
640 /* call afe block to set video inputs */ 640 /* call afe block to set video inputs */
641 status = cx231xx_afe_set_input_mux(dev, input); 641 status = cx231xx_afe_set_input_mux(dev, input);
642 if (status < 0) { 642 if (status < 0) {
643 dev_err(&dev->udev->dev, 643 dev_err(dev->dev,
644 "%s: set_input_mux :Failed to set AFE input mux - errCode [%d]!\n", 644 "%s: set_input_mux :Failed to set AFE input mux - errCode [%d]!\n",
645 __func__, status); 645 __func__, status);
646 return status; 646 return status;
@@ -672,7 +672,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
672 /* Tell DIF object to go to baseband mode */ 672 /* Tell DIF object to go to baseband mode */
673 status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND); 673 status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
674 if (status < 0) { 674 if (status < 0) {
675 dev_err(&dev->udev->dev, 675 dev_err(dev->dev,
676 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n", 676 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
677 __func__, status); 677 __func__, status);
678 return status; 678 return status;
@@ -717,7 +717,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
717 /* Tell DIF object to go to baseband mode */ 717 /* Tell DIF object to go to baseband mode */
718 status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND); 718 status = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
719 if (status < 0) { 719 if (status < 0) {
720 dev_err(&dev->udev->dev, 720 dev_err(dev->dev,
721 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n", 721 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
722 __func__, status); 722 __func__, status);
723 return status; 723 return status;
@@ -792,7 +792,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
792 status = cx231xx_dif_set_standard(dev, 792 status = cx231xx_dif_set_standard(dev,
793 DIF_USE_BASEBAND); 793 DIF_USE_BASEBAND);
794 if (status < 0) { 794 if (status < 0) {
795 dev_err(&dev->udev->dev, 795 dev_err(dev->dev,
796 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n", 796 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
797 __func__, status); 797 __func__, status);
798 return status; 798 return status;
@@ -828,7 +828,7 @@ int cx231xx_set_decoder_video_input(struct cx231xx *dev,
828 /* Reinitialize the DIF */ 828 /* Reinitialize the DIF */
829 status = cx231xx_dif_set_standard(dev, dev->norm); 829 status = cx231xx_dif_set_standard(dev, dev->norm);
830 if (status < 0) { 830 if (status < 0) {
831 dev_err(&dev->udev->dev, 831 dev_err(dev->dev,
832 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n", 832 "%s: cx231xx_dif set to By pass mode- errCode [%d]!\n",
833 __func__, status); 833 __func__, status);
834 return status; 834 return status;
@@ -972,14 +972,14 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
972{ 972{
973 int status = 0; 973 int status = 0;
974 974
975 dev_dbg(&dev->udev->dev, "%s: 0x%x\n", 975 dev_dbg(dev->dev, "%s: 0x%x\n",
976 __func__, (unsigned int)dev->norm); 976 __func__, (unsigned int)dev->norm);
977 977
978 /* Change the DFE_CTRL3 bp_percent to fix flagging */ 978 /* Change the DFE_CTRL3 bp_percent to fix flagging */
979 status = vid_blk_write_word(dev, DFE_CTRL3, 0xCD3F0280); 979 status = vid_blk_write_word(dev, DFE_CTRL3, 0xCD3F0280);
980 980
981 if (dev->norm & (V4L2_STD_NTSC | V4L2_STD_PAL_M)) { 981 if (dev->norm & (V4L2_STD_NTSC | V4L2_STD_PAL_M)) {
982 dev_dbg(&dev->udev->dev, "%s: NTSC\n", __func__); 982 dev_dbg(dev->dev, "%s: NTSC\n", __func__);
983 983
984 /* Move the close caption lines out of active video, 984 /* Move the close caption lines out of active video,
985 adjust the active video start point */ 985 adjust the active video start point */
@@ -1006,7 +1006,7 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
1006 (FLD_HBLANK_CNT, 0x79)); 1006 (FLD_HBLANK_CNT, 0x79));
1007 1007
1008 } else if (dev->norm & V4L2_STD_SECAM) { 1008 } else if (dev->norm & V4L2_STD_SECAM) {
1009 dev_dbg(&dev->udev->dev, "%s: SECAM\n", __func__); 1009 dev_dbg(dev->dev, "%s: SECAM\n", __func__);
1010 status = cx231xx_read_modify_write_i2c_dword(dev, 1010 status = cx231xx_read_modify_write_i2c_dword(dev,
1011 VID_BLK_I2C_ADDRESS, 1011 VID_BLK_I2C_ADDRESS,
1012 VERT_TIM_CTRL, 1012 VERT_TIM_CTRL,
@@ -1033,7 +1033,7 @@ int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev)
1033 cx231xx_set_field 1033 cx231xx_set_field
1034 (FLD_HBLANK_CNT, 0x85)); 1034 (FLD_HBLANK_CNT, 0x85));
1035 } else { 1035 } else {
1036 dev_dbg(&dev->udev->dev, "%s: PAL\n", __func__); 1036 dev_dbg(dev->dev, "%s: PAL\n", __func__);
1037 status = cx231xx_read_modify_write_i2c_dword(dev, 1037 status = cx231xx_read_modify_write_i2c_dword(dev,
1038 VID_BLK_I2C_ADDRESS, 1038 VID_BLK_I2C_ADDRESS,
1039 VERT_TIM_CTRL, 1039 VERT_TIM_CTRL,
@@ -1208,7 +1208,7 @@ int cx231xx_set_audio_decoder_input(struct cx231xx *dev,
1208 /* This is just a casual suggestion to people adding 1208 /* This is just a casual suggestion to people adding
1209 new boards in case they use a tuner type we don't 1209 new boards in case they use a tuner type we don't
1210 currently know about */ 1210 currently know about */
1211 dev_info(&dev->udev->dev, 1211 dev_info(dev->dev,
1212 "Unknown tuner type configuring SIF"); 1212 "Unknown tuner type configuring SIF");
1213 break; 1213 break;
1214 } 1214 }
@@ -1334,127 +1334,127 @@ void cx231xx_dump_HH_reg(struct cx231xx *dev)
1334 1334
1335 for (i = 0x100; i < 0x140; i++) { 1335 for (i = 0x100; i < 0x140; i++) {
1336 vid_blk_read_word(dev, i, &value); 1336 vid_blk_read_word(dev, i, &value);
1337 dev_dbg(&dev->udev->dev, "reg0x%x=0x%x\n", i, value); 1337 dev_dbg(dev->dev, "reg0x%x=0x%x\n", i, value);
1338 i = i+3; 1338 i = i+3;
1339 } 1339 }
1340 1340
1341 for (i = 0x300; i < 0x400; i++) { 1341 for (i = 0x300; i < 0x400; i++) {
1342 vid_blk_read_word(dev, i, &value); 1342 vid_blk_read_word(dev, i, &value);
1343 dev_dbg(&dev->udev->dev, "reg0x%x=0x%x\n", i, value); 1343 dev_dbg(dev->dev, "reg0x%x=0x%x\n", i, value);
1344 i = i+3; 1344 i = i+3;
1345 } 1345 }
1346 1346
1347 for (i = 0x400; i < 0x440; i++) { 1347 for (i = 0x400; i < 0x440; i++) {
1348 vid_blk_read_word(dev, i, &value); 1348 vid_blk_read_word(dev, i, &value);
1349 dev_dbg(&dev->udev->dev, "reg0x%x=0x%x\n", i, value); 1349 dev_dbg(dev->dev, "reg0x%x=0x%x\n", i, value);
1350 i = i+3; 1350 i = i+3;
1351 } 1351 }
1352 1352
1353 vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value); 1353 vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
1354 dev_dbg(&dev->udev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value); 1354 dev_dbg(dev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
1355 vid_blk_write_word(dev, AFE_CTRL_C2HH_SRC_CTRL, 0x4485D390); 1355 vid_blk_write_word(dev, AFE_CTRL_C2HH_SRC_CTRL, 0x4485D390);
1356 vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value); 1356 vid_blk_read_word(dev, AFE_CTRL_C2HH_SRC_CTRL, &value);
1357 dev_dbg(&dev->udev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value); 1357 dev_dbg(dev->dev, "AFE_CTRL_C2HH_SRC_CTRL=0x%x\n", value);
1358} 1358}
1359 1359
1360#if 0 1360#if 0
1361static void cx231xx_dump_SC_reg(struct cx231xx *dev) 1361static void cx231xx_dump_SC_reg(struct cx231xx *dev)
1362{ 1362{
1363 u8 value[4] = { 0, 0, 0, 0 }; 1363 u8 value[4] = { 0, 0, 0, 0 };
1364 dev_dbg(&dev->udev->dev, "%s!\n", __func__); 1364 dev_dbg(dev->dev, "%s!\n", __func__);
1365 1365
1366 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT, 1366 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT,
1367 value, 4); 1367 value, 4);
1368 dev_dbg(&dev->udev->dev, 1368 dev_dbg(dev->dev,
1369 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", BOARD_CFG_STAT, value[0], 1369 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", BOARD_CFG_STAT, value[0],
1370 value[1], value[2], value[3]); 1370 value[1], value[2], value[3]);
1371 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS_MODE_REG, 1371 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS_MODE_REG,
1372 value, 4); 1372 value, 4);
1373 dev_dbg(&dev->udev->dev, 1373 dev_dbg(dev->dev,
1374 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS_MODE_REG, value[0], 1374 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS_MODE_REG, value[0],
1375 value[1], value[2], value[3]); 1375 value[1], value[2], value[3]);
1376 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_CFG_REG, 1376 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_CFG_REG,
1377 value, 4); 1377 value, 4);
1378 dev_dbg(&dev->udev->dev, 1378 dev_dbg(dev->dev,
1379 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_CFG_REG, value[0], 1379 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_CFG_REG, value[0],
1380 value[1], value[2], value[3]); 1380 value[1], value[2], value[3]);
1381 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_LENGTH_REG, 1381 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS1_LENGTH_REG,
1382 value, 4); 1382 value, 4);
1383 dev_dbg(&dev->udev->dev, 1383 dev_dbg(dev->dev,
1384 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_LENGTH_REG, value[0], 1384 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS1_LENGTH_REG, value[0],
1385 value[1], value[2], value[3]); 1385 value[1], value[2], value[3]);
1386 1386
1387 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_CFG_REG, 1387 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_CFG_REG,
1388 value, 4); 1388 value, 4);
1389 dev_dbg(&dev->udev->dev, 1389 dev_dbg(dev->dev,
1390 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_CFG_REG, value[0], 1390 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_CFG_REG, value[0],
1391 value[1], value[2], value[3]); 1391 value[1], value[2], value[3]);
1392 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_LENGTH_REG, 1392 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, TS2_LENGTH_REG,
1393 value, 4); 1393 value, 4);
1394 dev_dbg(&dev->udev->dev, 1394 dev_dbg(dev->dev,
1395 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_LENGTH_REG, value[0], 1395 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", TS2_LENGTH_REG, value[0],
1396 value[1], value[2], value[3]); 1396 value[1], value[2], value[3]);
1397 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET, 1397 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET,
1398 value, 4); 1398 value, 4);
1399 dev_dbg(&dev->udev->dev, 1399 dev_dbg(dev->dev,
1400 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", EP_MODE_SET, value[0], 1400 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", EP_MODE_SET, value[0],
1401 value[1], value[2], value[3]); 1401 value[1], value[2], value[3]);
1402 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN1, 1402 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN1,
1403 value, 4); 1403 value, 4);
1404 dev_dbg(&dev->udev->dev, 1404 dev_dbg(dev->dev,
1405 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN1, value[0], 1405 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN1, value[0],
1406 value[1], value[2], value[3]); 1406 value[1], value[2], value[3]);
1407 1407
1408 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN2, 1408 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN2,
1409 value, 4); 1409 value, 4);
1410 dev_dbg(&dev->udev->dev, 1410 dev_dbg(dev->dev,
1411 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN2, value[0], 1411 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN2, value[0],
1412 value[1], value[2], value[3]); 1412 value[1], value[2], value[3]);
1413 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN3, 1413 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_PTN3,
1414 value, 4); 1414 value, 4);
1415 dev_dbg(&dev->udev->dev, 1415 dev_dbg(dev->dev,
1416 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN3, value[0], 1416 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_PTN3, value[0],
1417 value[1], value[2], value[3]); 1417 value[1], value[2], value[3]);
1418 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK0, 1418 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK0,
1419 value, 4); 1419 value, 4);
1420 dev_dbg(&dev->udev->dev, 1420 dev_dbg(dev->dev,
1421 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK0, value[0], 1421 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK0, value[0],
1422 value[1], value[2], value[3]); 1422 value[1], value[2], value[3]);
1423 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK1, 1423 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK1,
1424 value, 4); 1424 value, 4);
1425 dev_dbg(&dev->udev->dev, 1425 dev_dbg(dev->dev,
1426 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK1, value[0], 1426 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK1, value[0],
1427 value[1], value[2], value[3]); 1427 value[1], value[2], value[3]);
1428 1428
1429 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK2, 1429 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_PWR_MASK2,
1430 value, 4); 1430 value, 4);
1431 dev_dbg(&dev->udev->dev, 1431 dev_dbg(dev->dev,
1432 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK2, value[0], 1432 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_PWR_MASK2, value[0],
1433 value[1], value[2], value[3]); 1433 value[1], value[2], value[3]);
1434 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_GAIN, 1434 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_GAIN,
1435 value, 4); 1435 value, 4);
1436 dev_dbg(&dev->udev->dev, 1436 dev_dbg(dev->dev,
1437 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_GAIN, value[0], 1437 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_GAIN, value[0],
1438 value[1], value[2], value[3]); 1438 value[1], value[2], value[3]);
1439 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_CAR_REG, 1439 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_CAR_REG,
1440 value, 4); 1440 value, 4);
1441 dev_dbg(&dev->udev->dev, 1441 dev_dbg(dev->dev,
1442 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_CAR_REG, value[0], 1442 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_CAR_REG, value[0],
1443 value[1], value[2], value[3]); 1443 value[1], value[2], value[3]);
1444 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG1, 1444 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG1,
1445 value, 4); 1445 value, 4);
1446 dev_dbg(&dev->udev->dev, 1446 dev_dbg(dev->dev,
1447 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG1, value[0], 1447 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG1, value[0],
1448 value[1], value[2], value[3]); 1448 value[1], value[2], value[3]);
1449 1449
1450 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG2, 1450 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, CIR_OT_CFG2,
1451 value, 4); 1451 value, 4);
1452 dev_dbg(&dev->udev->dev, 1452 dev_dbg(dev->dev,
1453 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG2, value[0], 1453 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", CIR_OT_CFG2, value[0],
1454 value[1], value[2], value[3]); 1454 value[1], value[2], value[3]);
1455 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, PWR_CTL_EN, 1455 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, PWR_CTL_EN,
1456 value, 4); 1456 value, 4);
1457 dev_dbg(&dev->udev->dev, 1457 dev_dbg(dev->dev,
1458 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", PWR_CTL_EN, value[0], 1458 "reg0x%x=0x%x 0x%x 0x%x 0x%x\n", PWR_CTL_EN, value[0],
1459 value[1], value[2], value[3]); 1459 value[1], value[2], value[3]);
1460} 1460}
@@ -1524,7 +1524,7 @@ void cx231xx_set_Colibri_For_LowIF(struct cx231xx *dev, u32 if_freq,
1524 u32 standard = 0; 1524 u32 standard = 0;
1525 u8 value[4] = { 0, 0, 0, 0 }; 1525 u8 value[4] = { 0, 0, 0, 0 };
1526 1526
1527 dev_dbg(&dev->udev->dev, "Enter cx231xx_set_Colibri_For_LowIF()\n"); 1527 dev_dbg(dev->dev, "Enter cx231xx_set_Colibri_For_LowIF()\n");
1528 value[0] = (u8) 0x6F; 1528 value[0] = (u8) 0x6F;
1529 value[1] = (u8) 0x6F; 1529 value[1] = (u8) 0x6F;
1530 value[2] = (u8) 0x6F; 1530 value[2] = (u8) 0x6F;
@@ -1544,7 +1544,7 @@ void cx231xx_set_Colibri_For_LowIF(struct cx231xx *dev, u32 if_freq,
1544 colibri_carrier_offset = cx231xx_Get_Colibri_CarrierOffset(mode, 1544 colibri_carrier_offset = cx231xx_Get_Colibri_CarrierOffset(mode,
1545 standard); 1545 standard);
1546 1546
1547 dev_dbg(&dev->udev->dev, "colibri_carrier_offset=%d, standard=0x%x\n", 1547 dev_dbg(dev->dev, "colibri_carrier_offset=%d, standard=0x%x\n",
1548 colibri_carrier_offset, standard); 1548 colibri_carrier_offset, standard);
1549 1549
1550 /* Set the band Pass filter for DIF*/ 1550 /* Set the band Pass filter for DIF*/
@@ -1578,7 +1578,7 @@ void cx231xx_set_DIF_bandpass(struct cx231xx *dev, u32 if_freq,
1578 u64 pll_freq_u64 = 0; 1578 u64 pll_freq_u64 = 0;
1579 u32 i = 0; 1579 u32 i = 0;
1580 1580
1581 dev_dbg(&dev->udev->dev, "if_freq=%d;spectral_invert=0x%x;mode=0x%x\n", 1581 dev_dbg(dev->dev, "if_freq=%d;spectral_invert=0x%x;mode=0x%x\n",
1582 if_freq, spectral_invert, mode); 1582 if_freq, spectral_invert, mode);
1583 1583
1584 1584
@@ -1622,7 +1622,7 @@ void cx231xx_set_DIF_bandpass(struct cx231xx *dev, u32 if_freq,
1622 if_freq = 16000000; 1622 if_freq = 16000000;
1623 } 1623 }
1624 1624
1625 dev_dbg(&dev->udev->dev, "Enter IF=%zu\n", ARRAY_SIZE(Dif_set_array)); 1625 dev_dbg(dev->dev, "Enter IF=%zu\n", ARRAY_SIZE(Dif_set_array));
1626 for (i = 0; i < ARRAY_SIZE(Dif_set_array); i++) { 1626 for (i = 0; i < ARRAY_SIZE(Dif_set_array); i++) {
1627 if (Dif_set_array[i].if_freq == if_freq) { 1627 if (Dif_set_array[i].if_freq == if_freq) {
1628 vid_blk_write_word(dev, 1628 vid_blk_write_word(dev,
@@ -1734,7 +1734,7 @@ int cx231xx_dif_set_standard(struct cx231xx *dev, u32 standard)
1734 u32 dif_misc_ctrl_value = 0; 1734 u32 dif_misc_ctrl_value = 0;
1735 u32 func_mode = 0; 1735 u32 func_mode = 0;
1736 1736
1737 dev_dbg(&dev->udev->dev, "%s: setStandard to %x\n", __func__, standard); 1737 dev_dbg(dev->dev, "%s: setStandard to %x\n", __func__, standard);
1738 1738
1739 status = vid_blk_read_word(dev, DIF_MISC_CTRL, &dif_misc_ctrl_value); 1739 status = vid_blk_read_word(dev, DIF_MISC_CTRL, &dif_misc_ctrl_value);
1740 if (standard != DIF_USE_BASEBAND) 1740 if (standard != DIF_USE_BASEBAND)
@@ -2137,7 +2137,7 @@ int cx231xx_tuner_post_channel_change(struct cx231xx *dev)
2137{ 2137{
2138 int status = 0; 2138 int status = 0;
2139 u32 dwval; 2139 u32 dwval;
2140 dev_dbg(&dev->udev->dev, "%s: dev->tuner_type =0%d\n", 2140 dev_dbg(dev->dev, "%s: dev->tuner_type =0%d\n",
2141 __func__, dev->tuner_type); 2141 __func__, dev->tuner_type);
2142 /* Set the RF and IF k_agc values to 4 for PAL/NTSC and 8 for 2142 /* Set the RF and IF k_agc values to 4 for PAL/NTSC and 8 for
2143 * SECAM L/B/D standards */ 2143 * SECAM L/B/D standards */
@@ -2239,7 +2239,7 @@ int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode)
2239 if (dev->power_mode != mode) 2239 if (dev->power_mode != mode)
2240 dev->power_mode = mode; 2240 dev->power_mode = mode;
2241 else { 2241 else {
2242 dev_dbg(&dev->udev->dev, "%s: mode = %d, No Change req.\n", 2242 dev_dbg(dev->dev, "%s: mode = %d, No Change req.\n",
2243 __func__, mode); 2243 __func__, mode);
2244 return 0; 2244 return 0;
2245 } 2245 }
@@ -2479,7 +2479,7 @@ int cx231xx_start_stream(struct cx231xx *dev, u32 ep_mask)
2479 u32 tmp = 0; 2479 u32 tmp = 0;
2480 int status = 0; 2480 int status = 0;
2481 2481
2482 dev_dbg(&dev->udev->dev, "%s: ep_mask = %x\n", __func__, ep_mask); 2482 dev_dbg(dev->dev, "%s: ep_mask = %x\n", __func__, ep_mask);
2483 status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET, 2483 status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET,
2484 value, 4); 2484 value, 4);
2485 if (status < 0) 2485 if (status < 0)
@@ -2504,7 +2504,7 @@ int cx231xx_stop_stream(struct cx231xx *dev, u32 ep_mask)
2504 u32 tmp = 0; 2504 u32 tmp = 0;
2505 int status = 0; 2505 int status = 0;
2506 2506
2507 dev_dbg(&dev->udev->dev, "%s: ep_mask = %x\n", __func__, ep_mask); 2507 dev_dbg(dev->dev, "%s: ep_mask = %x\n", __func__, ep_mask);
2508 status = 2508 status =
2509 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET, value, 4); 2509 cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, EP_MODE_SET, value, 4);
2510 if (status < 0) 2510 if (status < 0)
@@ -2532,37 +2532,37 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
2532 if (dev->udev->speed == USB_SPEED_HIGH) { 2532 if (dev->udev->speed == USB_SPEED_HIGH) {
2533 switch (media_type) { 2533 switch (media_type) {
2534 case Audio: 2534 case Audio:
2535 dev_dbg(&dev->udev->dev, 2535 dev_dbg(dev->dev,
2536 "%s: Audio enter HANC\n", __func__); 2536 "%s: Audio enter HANC\n", __func__);
2537 status = 2537 status =
2538 cx231xx_mode_register(dev, TS_MODE_REG, 0x9300); 2538 cx231xx_mode_register(dev, TS_MODE_REG, 0x9300);
2539 break; 2539 break;
2540 2540
2541 case Vbi: 2541 case Vbi:
2542 dev_dbg(&dev->udev->dev, 2542 dev_dbg(dev->dev,
2543 "%s: set vanc registers\n", __func__); 2543 "%s: set vanc registers\n", __func__);
2544 status = cx231xx_mode_register(dev, TS_MODE_REG, 0x300); 2544 status = cx231xx_mode_register(dev, TS_MODE_REG, 0x300);
2545 break; 2545 break;
2546 2546
2547 case Sliced_cc: 2547 case Sliced_cc:
2548 dev_dbg(&dev->udev->dev, 2548 dev_dbg(dev->dev,
2549 "%s: set hanc registers\n", __func__); 2549 "%s: set hanc registers\n", __func__);
2550 status = 2550 status =
2551 cx231xx_mode_register(dev, TS_MODE_REG, 0x1300); 2551 cx231xx_mode_register(dev, TS_MODE_REG, 0x1300);
2552 break; 2552 break;
2553 2553
2554 case Raw_Video: 2554 case Raw_Video:
2555 dev_dbg(&dev->udev->dev, 2555 dev_dbg(dev->dev,
2556 "%s: set video registers\n", __func__); 2556 "%s: set video registers\n", __func__);
2557 status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100); 2557 status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100);
2558 break; 2558 break;
2559 2559
2560 case TS1_serial_mode: 2560 case TS1_serial_mode:
2561 dev_dbg(&dev->udev->dev, 2561 dev_dbg(dev->dev,
2562 "%s: set ts1 registers", __func__); 2562 "%s: set ts1 registers", __func__);
2563 2563
2564 if (dev->board.has_417) { 2564 if (dev->board.has_417) {
2565 dev_dbg(&dev->udev->dev, 2565 dev_dbg(dev->dev,
2566 "%s: MPEG\n", __func__); 2566 "%s: MPEG\n", __func__);
2567 value &= 0xFFFFFFFC; 2567 value &= 0xFFFFFFFC;
2568 value |= 0x3; 2568 value |= 0x3;
@@ -2586,7 +2586,7 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
2586 VRT_SET_REGISTER, 2586 VRT_SET_REGISTER,
2587 TS1_LENGTH_REG, val, 4); 2587 TS1_LENGTH_REG, val, 4);
2588 } else { 2588 } else {
2589 dev_dbg(&dev->udev->dev, "%s: BDA\n", __func__); 2589 dev_dbg(dev->dev, "%s: BDA\n", __func__);
2590 status = cx231xx_mode_register(dev, 2590 status = cx231xx_mode_register(dev,
2591 TS_MODE_REG, 0x101); 2591 TS_MODE_REG, 0x101);
2592 status = cx231xx_mode_register(dev, 2592 status = cx231xx_mode_register(dev,
@@ -2595,7 +2595,7 @@ int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type)
2595 break; 2595 break;
2596 2596
2597 case TS1_parallel_mode: 2597 case TS1_parallel_mode:
2598 dev_dbg(&dev->udev->dev, 2598 dev_dbg(dev->dev,
2599 "%s: set ts1 parallel mode registers\n", 2599 "%s: set ts1 parallel mode registers\n",
2600 __func__); 2600 __func__);
2601 status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100); 2601 status = cx231xx_mode_register(dev, TS_MODE_REG, 0x100);
@@ -2950,7 +2950,7 @@ int cx231xx_gpio_i2c_read_ack(struct cx231xx *dev)
2950 (nCnt > 0)); 2950 (nCnt > 0));
2951 2951
2952 if (nCnt == 0) 2952 if (nCnt == 0)
2953 dev_dbg(&dev->udev->dev, 2953 dev_dbg(dev->dev,
2954 "No ACK after %d msec -GPIO I2C failed!", 2954 "No ACK after %d msec -GPIO I2C failed!",
2955 nInit * 10); 2955 nInit * 10);
2956 2956
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 7156344e7022..ae05d591f228 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -855,7 +855,7 @@ int cx231xx_tuner_callback(void *ptr, int component, int command, int arg)
855 855
856 if (dev->tuner_type == TUNER_XC5000) { 856 if (dev->tuner_type == TUNER_XC5000) {
857 if (command == XC5000_TUNER_RESET) { 857 if (command == XC5000_TUNER_RESET) {
858 dev_dbg(&dev->udev->dev, 858 dev_dbg(dev->dev,
859 "Tuner CB: RESET: cmd %d : tuner type %d\n", 859 "Tuner CB: RESET: cmd %d : tuner type %d\n",
860 command, dev->tuner_type); 860 command, dev->tuner_type);
861 cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit, 861 cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit,
@@ -915,7 +915,7 @@ void cx231xx_pre_card_setup(struct cx231xx *dev)
915 915
916 cx231xx_set_model(dev); 916 cx231xx_set_model(dev);
917 917
918 dev_info(&dev->udev->dev, "Identified as %s (card=%d)\n", 918 dev_info(dev->dev, "Identified as %s (card=%d)\n",
919 dev->board.name, dev->model); 919 dev->board.name, dev->model);
920 920
921 /* set the direction for GPIO pins */ 921 /* set the direction for GPIO pins */
@@ -989,7 +989,7 @@ static int read_eeprom(struct cx231xx *dev, struct i2c_client *client,
989 /* start reading at offset 0 */ 989 /* start reading at offset 0 */
990 ret = i2c_transfer(client->adapter, &msg_write, 1); 990 ret = i2c_transfer(client->adapter, &msg_write, 1);
991 if (ret < 0) { 991 if (ret < 0) {
992 dev_err(&dev->udev->dev, "Can't read eeprom\n"); 992 dev_err(dev->dev, "Can't read eeprom\n");
993 return ret; 993 return ret;
994 } 994 }
995 995
@@ -999,7 +999,7 @@ static int read_eeprom(struct cx231xx *dev, struct i2c_client *client,
999 999
1000 ret = i2c_transfer(client->adapter, &msg_read, 1); 1000 ret = i2c_transfer(client->adapter, &msg_read, 1);
1001 if (ret < 0) { 1001 if (ret < 0) {
1002 dev_err(&dev->udev->dev, "Can't read eeprom\n"); 1002 dev_err(dev->dev, "Can't read eeprom\n");
1003 return ret; 1003 return ret;
1004 } 1004 }
1005 eedata_cur += msg_read.len; 1005 eedata_cur += msg_read.len;
@@ -1007,7 +1007,7 @@ static int read_eeprom(struct cx231xx *dev, struct i2c_client *client,
1007 } 1007 }
1008 1008
1009 for (i = 0; i + 15 < len; i += 16) 1009 for (i = 0; i + 15 < len; i += 16)
1010 dev_dbg(&dev->udev->dev, "i2c eeprom %02x: %*ph\n", 1010 dev_dbg(dev->dev, "i2c eeprom %02x: %*ph\n",
1011 i, 16, &eedata[i]); 1011 i, 16, &eedata[i]);
1012 1012
1013 return 0; 1013 return 0;
@@ -1028,7 +1028,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
1028 cx231xx_get_i2c_adap(dev, I2C_0), 1028 cx231xx_get_i2c_adap(dev, I2C_0),
1029 "cx25840", 0x88 >> 1, NULL); 1029 "cx25840", 0x88 >> 1, NULL);
1030 if (dev->sd_cx25840 == NULL) 1030 if (dev->sd_cx25840 == NULL)
1031 dev_err(&dev->udev->dev, 1031 dev_err(dev->dev,
1032 "cx25840 subdev registration failure\n"); 1032 "cx25840 subdev registration failure\n");
1033 cx25840_call(dev, core, load_fw); 1033 cx25840_call(dev, core, load_fw);
1034 1034
@@ -1043,7 +1043,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
1043 "tuner", 1043 "tuner",
1044 dev->tuner_addr, NULL); 1044 dev->tuner_addr, NULL);
1045 if (dev->sd_tuner == NULL) 1045 if (dev->sd_tuner == NULL)
1046 dev_err(&dev->udev->dev, 1046 dev_err(dev->dev,
1047 "tuner subdev registration failure\n"); 1047 "tuner subdev registration failure\n");
1048 else 1048 else
1049 cx231xx_config_tuner(dev); 1049 cx231xx_config_tuner(dev);
@@ -1150,7 +1150,7 @@ static int cx231xx_init_dev(struct cx231xx *dev, struct usb_device *udev,
1150 /* Query cx231xx to find what pcb config it is related to */ 1150 /* Query cx231xx to find what pcb config it is related to */
1151 retval = initialize_cx231xx(dev); 1151 retval = initialize_cx231xx(dev);
1152 if (retval < 0) { 1152 if (retval < 0) {
1153 dev_err(&udev->dev, "Failed to read PCB config\n"); 1153 dev_err(dev->dev, "Failed to read PCB config\n");
1154 return retval; 1154 return retval;
1155 } 1155 }
1156 1156
@@ -1166,7 +1166,7 @@ static int cx231xx_init_dev(struct cx231xx *dev, struct usb_device *udev,
1166 1166
1167 retval = cx231xx_config(dev); 1167 retval = cx231xx_config(dev);
1168 if (retval) { 1168 if (retval) {
1169 dev_err(&udev->dev, "error configuring device\n"); 1169 dev_err(dev->dev, "error configuring device\n");
1170 return -ENOMEM; 1170 return -ENOMEM;
1171 } 1171 }
1172 1172
@@ -1176,7 +1176,7 @@ static int cx231xx_init_dev(struct cx231xx *dev, struct usb_device *udev,
1176 /* register i2c bus */ 1176 /* register i2c bus */
1177 retval = cx231xx_dev_init(dev); 1177 retval = cx231xx_dev_init(dev);
1178 if (retval) { 1178 if (retval) {
1179 dev_err(&udev->dev, 1179 dev_err(dev->dev,
1180 "%s: cx231xx_i2c_register - errCode [%d]!\n", 1180 "%s: cx231xx_i2c_register - errCode [%d]!\n",
1181 __func__, retval); 1181 __func__, retval);
1182 goto err_dev_init; 1182 goto err_dev_init;
@@ -1199,8 +1199,8 @@ static int cx231xx_init_dev(struct cx231xx *dev, struct usb_device *udev,
1199 1199
1200 retval = cx231xx_config(dev); 1200 retval = cx231xx_config(dev);
1201 if (retval) { 1201 if (retval) {
1202 dev_err(&udev->dev, "%s: cx231xx_config - errCode [%d]!\n", 1202 dev_err(dev->dev, "%s: cx231xx_config - errCode [%d]!\n",
1203 __func__, retval); 1203 __func__, retval);
1204 goto err_dev_init; 1204 goto err_dev_init;
1205 } 1205 }
1206 1206
@@ -1216,9 +1216,9 @@ static int cx231xx_init_dev(struct cx231xx *dev, struct usb_device *udev,
1216 cx231xx_add_into_devlist(dev); 1216 cx231xx_add_into_devlist(dev);
1217 1217
1218 if (dev->board.has_417) { 1218 if (dev->board.has_417) {
1219 dev_info(&udev->dev, "attach 417 %d\n", dev->model); 1219 dev_info(dev->dev, "attach 417 %d\n", dev->model);
1220 if (cx231xx_417_register(dev) < 0) { 1220 if (cx231xx_417_register(dev) < 0) {
1221 dev_err(&udev->dev, 1221 dev_err(dev->dev,
1222 "%s() Failed to register 417 on VID_B\n", 1222 "%s() Failed to register 417 on VID_B\n",
1223 __func__); 1223 __func__);
1224 } 1224 }
@@ -1284,7 +1284,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1284 /* compute alternate max packet sizes for video */ 1284 /* compute alternate max packet sizes for video */
1285 idx = dev->current_pcb_config.hs_config_info[0].interface_info.video_index + 1; 1285 idx = dev->current_pcb_config.hs_config_info[0].interface_info.video_index + 1;
1286 if (idx >= dev->max_iad_interface_count) { 1286 if (idx >= dev->max_iad_interface_count) {
1287 dev_err(&dev->udev->dev, 1287 dev_err(dev->dev,
1288 "Video PCB interface #%d doesn't exist\n", idx); 1288 "Video PCB interface #%d doesn't exist\n", idx);
1289 return -ENODEV; 1289 return -ENODEV;
1290 } 1290 }
@@ -1294,7 +1294,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1294 dev->video_mode.end_point_addr = uif->altsetting[0].endpoint[isoc_pipe].desc.bEndpointAddress; 1294 dev->video_mode.end_point_addr = uif->altsetting[0].endpoint[isoc_pipe].desc.bEndpointAddress;
1295 dev->video_mode.num_alt = uif->num_altsetting; 1295 dev->video_mode.num_alt = uif->num_altsetting;
1296 1296
1297 dev_info(&dev->udev->dev, 1297 dev_info(dev->dev,
1298 "video EndPoint Addr 0x%x, Alternate settings: %i\n", 1298 "video EndPoint Addr 0x%x, Alternate settings: %i\n",
1299 dev->video_mode.end_point_addr, 1299 dev->video_mode.end_point_addr,
1300 dev->video_mode.num_alt); 1300 dev->video_mode.num_alt);
@@ -1306,7 +1306,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1306 for (i = 0; i < dev->video_mode.num_alt; i++) { 1306 for (i = 0; i < dev->video_mode.num_alt; i++) {
1307 u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.wMaxPacketSize); 1307 u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.wMaxPacketSize);
1308 dev->video_mode.alt_max_pkt_size[i] = (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); 1308 dev->video_mode.alt_max_pkt_size[i] = (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1309 dev_dbg(&dev->udev->dev, 1309 dev_dbg(dev->dev,
1310 "Alternate setting %i, max size= %i\n", i, 1310 "Alternate setting %i, max size= %i\n", i,
1311 dev->video_mode.alt_max_pkt_size[i]); 1311 dev->video_mode.alt_max_pkt_size[i]);
1312 } 1312 }
@@ -1315,7 +1315,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1315 1315
1316 idx = dev->current_pcb_config.hs_config_info[0].interface_info.vanc_index + 1; 1316 idx = dev->current_pcb_config.hs_config_info[0].interface_info.vanc_index + 1;
1317 if (idx >= dev->max_iad_interface_count) { 1317 if (idx >= dev->max_iad_interface_count) {
1318 dev_err(&dev->udev->dev, 1318 dev_err(dev->dev,
1319 "VBI PCB interface #%d doesn't exist\n", idx); 1319 "VBI PCB interface #%d doesn't exist\n", idx);
1320 return -ENODEV; 1320 return -ENODEV;
1321 } 1321 }
@@ -1326,7 +1326,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1326 bEndpointAddress; 1326 bEndpointAddress;
1327 1327
1328 dev->vbi_mode.num_alt = uif->num_altsetting; 1328 dev->vbi_mode.num_alt = uif->num_altsetting;
1329 dev_info(&dev->udev->dev, 1329 dev_info(dev->dev,
1330 "VBI EndPoint Addr 0x%x, Alternate settings: %i\n", 1330 "VBI EndPoint Addr 0x%x, Alternate settings: %i\n",
1331 dev->vbi_mode.end_point_addr, 1331 dev->vbi_mode.end_point_addr,
1332 dev->vbi_mode.num_alt); 1332 dev->vbi_mode.num_alt);
@@ -1342,7 +1342,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1342 desc.wMaxPacketSize); 1342 desc.wMaxPacketSize);
1343 dev->vbi_mode.alt_max_pkt_size[i] = 1343 dev->vbi_mode.alt_max_pkt_size[i] =
1344 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); 1344 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1345 dev_dbg(&dev->udev->dev, 1345 dev_dbg(dev->dev,
1346 "Alternate setting %i, max size= %i\n", i, 1346 "Alternate setting %i, max size= %i\n", i,
1347 dev->vbi_mode.alt_max_pkt_size[i]); 1347 dev->vbi_mode.alt_max_pkt_size[i]);
1348 } 1348 }
@@ -1352,7 +1352,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1352 /* compute alternate max packet sizes for sliced CC */ 1352 /* compute alternate max packet sizes for sliced CC */
1353 idx = dev->current_pcb_config.hs_config_info[0].interface_info.hanc_index + 1; 1353 idx = dev->current_pcb_config.hs_config_info[0].interface_info.hanc_index + 1;
1354 if (idx >= dev->max_iad_interface_count) { 1354 if (idx >= dev->max_iad_interface_count) {
1355 dev_err(&dev->udev->dev, 1355 dev_err(dev->dev,
1356 "Sliced CC PCB interface #%d doesn't exist\n", idx); 1356 "Sliced CC PCB interface #%d doesn't exist\n", idx);
1357 return -ENODEV; 1357 return -ENODEV;
1358 } 1358 }
@@ -1363,7 +1363,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1363 bEndpointAddress; 1363 bEndpointAddress;
1364 1364
1365 dev->sliced_cc_mode.num_alt = uif->num_altsetting; 1365 dev->sliced_cc_mode.num_alt = uif->num_altsetting;
1366 dev_info(&dev->udev->dev, 1366 dev_info(dev->dev,
1367 "sliced CC EndPoint Addr 0x%x, Alternate settings: %i\n", 1367 "sliced CC EndPoint Addr 0x%x, Alternate settings: %i\n",
1368 dev->sliced_cc_mode.end_point_addr, 1368 dev->sliced_cc_mode.end_point_addr,
1369 dev->sliced_cc_mode.num_alt); 1369 dev->sliced_cc_mode.num_alt);
@@ -1376,7 +1376,7 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
1376 desc.wMaxPacketSize); 1376 desc.wMaxPacketSize);
1377 dev->sliced_cc_mode.alt_max_pkt_size[i] = 1377 dev->sliced_cc_mode.alt_max_pkt_size[i] =
1378 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); 1378 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1379 dev_dbg(&dev->udev->dev, 1379 dev_dbg(dev->dev,
1380 "Alternate setting %i, max size= %i\n", i, 1380 "Alternate setting %i, max size= %i\n", i,
1381 dev->sliced_cc_mode.alt_max_pkt_size[i]); 1381 dev->sliced_cc_mode.alt_max_pkt_size[i]);
1382 } 1382 }
@@ -1392,6 +1392,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1392 const struct usb_device_id *id) 1392 const struct usb_device_id *id)
1393{ 1393{
1394 struct usb_device *udev; 1394 struct usb_device *udev;
1395 struct device *d = &interface->dev;
1395 struct usb_interface *uif; 1396 struct usb_interface *uif;
1396 struct cx231xx *dev = NULL; 1397 struct cx231xx *dev = NULL;
1397 int retval = -ENODEV; 1398 int retval = -ENODEV;
@@ -1416,7 +1417,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1416 nr = find_first_zero_bit(&cx231xx_devused, CX231XX_MAXBOARDS); 1417 nr = find_first_zero_bit(&cx231xx_devused, CX231XX_MAXBOARDS);
1417 if (nr >= CX231XX_MAXBOARDS) { 1418 if (nr >= CX231XX_MAXBOARDS) {
1418 /* No free device slots */ 1419 /* No free device slots */
1419 dev_err(&udev->dev, 1420 dev_err(d,
1420 "Supports only %i devices.\n", 1421 "Supports only %i devices.\n",
1421 CX231XX_MAXBOARDS); 1422 CX231XX_MAXBOARDS);
1422 return -ENOMEM; 1423 return -ENOMEM;
@@ -1434,6 +1435,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1434 dev->devno = nr; 1435 dev->devno = nr;
1435 dev->model = id->driver_info; 1436 dev->model = id->driver_info;
1436 dev->video_mode.alt = -1; 1437 dev->video_mode.alt = -1;
1438 dev->dev = d;
1437 1439
1438 dev->interface_count++; 1440 dev->interface_count++;
1439 /* reset gpio dir and value */ 1441 /* reset gpio dir and value */
@@ -1472,7 +1474,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1472 speed = "unknown"; 1474 speed = "unknown";
1473 } 1475 }
1474 1476
1475 dev_info(&udev->dev, 1477 dev_info(d,
1476 "New device %s %s @ %s Mbps (%04x:%04x) with %d interfaces\n", 1478 "New device %s %s @ %s Mbps (%04x:%04x) with %d interfaces\n",
1477 udev->manufacturer ? udev->manufacturer : "", 1479 udev->manufacturer ? udev->manufacturer : "",
1478 udev->product ? udev->product : "", 1480 udev->product ? udev->product : "",
@@ -1489,12 +1491,12 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1489 1491
1490 assoc_desc = udev->actconfig->intf_assoc[0]; 1492 assoc_desc = udev->actconfig->intf_assoc[0];
1491 if (assoc_desc->bFirstInterface != ifnum) { 1493 if (assoc_desc->bFirstInterface != ifnum) {
1492 dev_err(&udev->dev, "Not found matching IAD interface\n"); 1494 dev_err(d, "Not found matching IAD interface\n");
1493 retval = -ENODEV; 1495 retval = -ENODEV;
1494 goto err_if; 1496 goto err_if;
1495 } 1497 }
1496 1498
1497 dev_dbg(&udev->dev, "registering interface %d\n", ifnum); 1499 dev_dbg(d, "registering interface %d\n", ifnum);
1498 1500
1499 /* save our data pointer in this interface device */ 1501 /* save our data pointer in this interface device */
1500 usb_set_intfdata(interface, dev); 1502 usb_set_intfdata(interface, dev);
@@ -1502,7 +1504,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1502 /* Create v4l2 device */ 1504 /* Create v4l2 device */
1503 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev); 1505 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
1504 if (retval) { 1506 if (retval) {
1505 dev_err(&udev->dev, "v4l2_device_register failed\n"); 1507 dev_err(d, "v4l2_device_register failed\n");
1506 goto err_v4l2; 1508 goto err_v4l2;
1507 } 1509 }
1508 1510
@@ -1519,8 +1521,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1519 /* compute alternate max packet sizes for TS1 */ 1521 /* compute alternate max packet sizes for TS1 */
1520 idx = dev->current_pcb_config.hs_config_info[0].interface_info.ts1_index + 1; 1522 idx = dev->current_pcb_config.hs_config_info[0].interface_info.ts1_index + 1;
1521 if (idx >= dev->max_iad_interface_count) { 1523 if (idx >= dev->max_iad_interface_count) {
1522 dev_err(&udev->dev, 1524 dev_err(d, "TS1 PCB interface #%d doesn't exist\n",
1523 "TS1 PCB interface #%d doesn't exist\n", idx); 1525 idx);
1524 retval = -ENODEV; 1526 retval = -ENODEV;
1525 goto err_video_alt; 1527 goto err_video_alt;
1526 } 1528 }
@@ -1531,7 +1533,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1531 desc.bEndpointAddress; 1533 desc.bEndpointAddress;
1532 1534
1533 dev->ts1_mode.num_alt = uif->num_altsetting; 1535 dev->ts1_mode.num_alt = uif->num_altsetting;
1534 dev_info(&udev->dev, 1536 dev_info(d,
1535 "TS EndPoint Addr 0x%x, Alternate settings: %i\n", 1537 "TS EndPoint Addr 0x%x, Alternate settings: %i\n",
1536 dev->ts1_mode.end_point_addr, 1538 dev->ts1_mode.end_point_addr,
1537 dev->ts1_mode.num_alt); 1539 dev->ts1_mode.num_alt);
@@ -1548,9 +1550,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
1548 wMaxPacketSize); 1550 wMaxPacketSize);
1549 dev->ts1_mode.alt_max_pkt_size[i] = 1551 dev->ts1_mode.alt_max_pkt_size[i] =
1550 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1); 1552 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
1551 dev_dbg(&udev->dev, 1553 dev_dbg(d, "Alternate setting %i, max size= %i\n",
1552 "Alternate setting %i, max size= %i\n", i, 1554 i, dev->ts1_mode.alt_max_pkt_size[i]);
1553 dev->ts1_mode.alt_max_pkt_size[i]);
1554 } 1555 }
1555 } 1556 }
1556 1557
@@ -1614,7 +1615,7 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface)
1614 wake_up_interruptible_all(&dev->open); 1615 wake_up_interruptible_all(&dev->open);
1615 1616
1616 if (dev->users) { 1617 if (dev->users) {
1617 dev_warn(&dev->udev->dev, 1618 dev_warn(dev->dev,
1618 "device %s is open! Deregistration and memory deallocation are deferred on close.\n", 1619 "device %s is open! Deregistration and memory deallocation are deferred on close.\n",
1619 video_device_node_name(dev->vdev)); 1620 video_device_node_name(dev->vdev));
1620 1621
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
index 64e907f02a02..4a3f28c4e8d3 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -100,7 +100,7 @@ int cx231xx_register_extension(struct cx231xx_ops *ops)
100 list_add_tail(&ops->next, &cx231xx_extension_devlist); 100 list_add_tail(&ops->next, &cx231xx_extension_devlist);
101 list_for_each_entry(dev, &cx231xx_devlist, devlist) { 101 list_for_each_entry(dev, &cx231xx_devlist, devlist) {
102 ops->init(dev); 102 ops->init(dev);
103 dev_info(&dev->udev->dev, "%s initialized\n", ops->name); 103 dev_info(dev->dev, "%s initialized\n", ops->name);
104 } 104 }
105 mutex_unlock(&cx231xx_devlist_mutex); 105 mutex_unlock(&cx231xx_devlist_mutex);
106 return 0; 106 return 0;
@@ -114,7 +114,7 @@ void cx231xx_unregister_extension(struct cx231xx_ops *ops)
114 mutex_lock(&cx231xx_devlist_mutex); 114 mutex_lock(&cx231xx_devlist_mutex);
115 list_for_each_entry(dev, &cx231xx_devlist, devlist) { 115 list_for_each_entry(dev, &cx231xx_devlist, devlist) {
116 ops->fini(dev); 116 ops->fini(dev);
117 dev_info(&dev->udev->dev, "%s removed\n", ops->name); 117 dev_info(dev->dev, "%s removed\n", ops->name);
118 } 118 }
119 119
120 list_del(&ops->next); 120 list_del(&ops->next);
@@ -227,7 +227,7 @@ int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus,
227 /* call common vendor command request */ 227 /* call common vendor command request */
228 status = cx231xx_send_vendor_cmd(dev, &ven_req); 228 status = cx231xx_send_vendor_cmd(dev, &ven_req);
229 if (status < 0 && !dev->i2c_scan_running) { 229 if (status < 0 && !dev->i2c_scan_running) {
230 dev_err(&dev->udev->dev, "%s: failed with status -%d\n", 230 dev_err(dev->dev, "%s: failed with status -%d\n",
231 __func__, status); 231 __func__, status);
232 } 232 }
233 233
@@ -522,7 +522,7 @@ int cx231xx_set_video_alternate(struct cx231xx *dev)
522 usb_set_interface(dev->udev, usb_interface_index, 522 usb_set_interface(dev->udev, usb_interface_index,
523 dev->video_mode.alt); 523 dev->video_mode.alt);
524 if (errCode < 0) { 524 if (errCode < 0) {
525 dev_err(&dev->udev->dev, 525 dev_err(dev->dev,
526 "cannot change alt number to %d (error=%i)\n", 526 "cannot change alt number to %d (error=%i)\n",
527 dev->video_mode.alt, errCode); 527 dev->video_mode.alt, errCode);
528 return errCode; 528 return errCode;
@@ -598,7 +598,7 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
598 } 598 }
599 599
600 if (alt > 0 && max_pkt_size == 0) { 600 if (alt > 0 && max_pkt_size == 0) {
601 dev_err(&dev->udev->dev, 601 dev_err(dev->dev,
602 "can't change interface %d alt no. to %d: Max. Pkt size = 0\n", 602 "can't change interface %d alt no. to %d: Max. Pkt size = 0\n",
603 usb_interface_index, alt); 603 usb_interface_index, alt);
604 /*To workaround error number=-71 on EP0 for videograbber, 604 /*To workaround error number=-71 on EP0 for videograbber,
@@ -614,7 +614,7 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
614 if (usb_interface_index > 0) { 614 if (usb_interface_index > 0) {
615 status = usb_set_interface(dev->udev, usb_interface_index, alt); 615 status = usb_set_interface(dev->udev, usb_interface_index, alt);
616 if (status < 0) { 616 if (status < 0) {
617 dev_err(&dev->udev->dev, 617 dev_err(dev->dev,
618 "can't change interface %d alt no. to %d (err=%i)\n", 618 "can't change interface %d alt no. to %d (err=%i)\n",
619 usb_interface_index, alt, status); 619 usb_interface_index, alt, status);
620 return status; 620 return status;
@@ -773,7 +773,7 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)
773 buffer, 4096, &actlen, 2000); 773 buffer, 4096, &actlen, 2000);
774 774
775 if (ret) 775 if (ret)
776 dev_err(&dev->udev->dev, 776 dev_err(dev->dev,
777 "bulk message failed: %d (%d/%d)", ret, 777 "bulk message failed: %d (%d/%d)", ret,
778 size, actlen); 778 size, actlen);
779 else { 779 else {
@@ -1011,7 +1011,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
1011 dev->video_mode.isoc_ctl.urb = 1011 dev->video_mode.isoc_ctl.urb =
1012 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL); 1012 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
1013 if (!dev->video_mode.isoc_ctl.urb) { 1013 if (!dev->video_mode.isoc_ctl.urb) {
1014 dev_err(&dev->udev->dev, 1014 dev_err(dev->dev,
1015 "cannot alloc memory for usb buffers\n"); 1015 "cannot alloc memory for usb buffers\n");
1016 return -ENOMEM; 1016 return -ENOMEM;
1017 } 1017 }
@@ -1019,7 +1019,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
1019 dev->video_mode.isoc_ctl.transfer_buffer = 1019 dev->video_mode.isoc_ctl.transfer_buffer =
1020 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL); 1020 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
1021 if (!dev->video_mode.isoc_ctl.transfer_buffer) { 1021 if (!dev->video_mode.isoc_ctl.transfer_buffer) {
1022 dev_err(&dev->udev->dev, 1022 dev_err(dev->dev,
1023 "cannot allocate memory for usbtransfer\n"); 1023 "cannot allocate memory for usbtransfer\n");
1024 kfree(dev->video_mode.isoc_ctl.urb); 1024 kfree(dev->video_mode.isoc_ctl.urb);
1025 return -ENOMEM; 1025 return -ENOMEM;
@@ -1040,7 +1040,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
1040 for (i = 0; i < dev->video_mode.isoc_ctl.num_bufs; i++) { 1040 for (i = 0; i < dev->video_mode.isoc_ctl.num_bufs; i++) {
1041 urb = usb_alloc_urb(max_packets, GFP_KERNEL); 1041 urb = usb_alloc_urb(max_packets, GFP_KERNEL);
1042 if (!urb) { 1042 if (!urb) {
1043 dev_err(&dev->udev->dev, 1043 dev_err(dev->dev,
1044 "cannot alloc isoc_ctl.urb %i\n", i); 1044 "cannot alloc isoc_ctl.urb %i\n", i);
1045 cx231xx_uninit_isoc(dev); 1045 cx231xx_uninit_isoc(dev);
1046 return -ENOMEM; 1046 return -ENOMEM;
@@ -1051,7 +1051,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
1051 usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, 1051 usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
1052 &urb->transfer_dma); 1052 &urb->transfer_dma);
1053 if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) { 1053 if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
1054 dev_err(&dev->udev->dev, 1054 dev_err(dev->dev,
1055 "unable to allocate %i bytes for transfer buffer %i%s\n", 1055 "unable to allocate %i bytes for transfer buffer %i%s\n",
1056 sb_size, i, 1056 sb_size, i,
1057 in_interrupt() ? " while in int" : ""); 1057 in_interrupt() ? " while in int" : "");
@@ -1086,7 +1086,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
1086 rc = usb_submit_urb(dev->video_mode.isoc_ctl.urb[i], 1086 rc = usb_submit_urb(dev->video_mode.isoc_ctl.urb[i],
1087 GFP_ATOMIC); 1087 GFP_ATOMIC);
1088 if (rc) { 1088 if (rc) {
1089 dev_err(&dev->udev->dev, 1089 dev_err(dev->dev,
1090 "submit of urb %i failed (error=%i)\n", i, 1090 "submit of urb %i failed (error=%i)\n", i,
1091 rc); 1091 rc);
1092 cx231xx_uninit_isoc(dev); 1092 cx231xx_uninit_isoc(dev);
@@ -1148,7 +1148,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
1148 dev->video_mode.bulk_ctl.urb = 1148 dev->video_mode.bulk_ctl.urb =
1149 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL); 1149 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
1150 if (!dev->video_mode.bulk_ctl.urb) { 1150 if (!dev->video_mode.bulk_ctl.urb) {
1151 dev_err(&dev->udev->dev, 1151 dev_err(dev->dev,
1152 "cannot alloc memory for usb buffers\n"); 1152 "cannot alloc memory for usb buffers\n");
1153 return -ENOMEM; 1153 return -ENOMEM;
1154 } 1154 }
@@ -1156,7 +1156,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
1156 dev->video_mode.bulk_ctl.transfer_buffer = 1156 dev->video_mode.bulk_ctl.transfer_buffer =
1157 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL); 1157 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
1158 if (!dev->video_mode.bulk_ctl.transfer_buffer) { 1158 if (!dev->video_mode.bulk_ctl.transfer_buffer) {
1159 dev_err(&dev->udev->dev, 1159 dev_err(dev->dev,
1160 "cannot allocate memory for usbtransfer\n"); 1160 "cannot allocate memory for usbtransfer\n");
1161 kfree(dev->video_mode.bulk_ctl.urb); 1161 kfree(dev->video_mode.bulk_ctl.urb);
1162 return -ENOMEM; 1162 return -ENOMEM;
@@ -1177,7 +1177,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
1177 for (i = 0; i < dev->video_mode.bulk_ctl.num_bufs; i++) { 1177 for (i = 0; i < dev->video_mode.bulk_ctl.num_bufs; i++) {
1178 urb = usb_alloc_urb(0, GFP_KERNEL); 1178 urb = usb_alloc_urb(0, GFP_KERNEL);
1179 if (!urb) { 1179 if (!urb) {
1180 dev_err(&dev->udev->dev, 1180 dev_err(dev->dev,
1181 "cannot alloc bulk_ctl.urb %i\n", i); 1181 "cannot alloc bulk_ctl.urb %i\n", i);
1182 cx231xx_uninit_bulk(dev); 1182 cx231xx_uninit_bulk(dev);
1183 return -ENOMEM; 1183 return -ENOMEM;
@@ -1189,7 +1189,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
1189 usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, 1189 usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
1190 &urb->transfer_dma); 1190 &urb->transfer_dma);
1191 if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) { 1191 if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) {
1192 dev_err(&dev->udev->dev, 1192 dev_err(dev->dev,
1193 "unable to allocate %i bytes for transfer buffer %i%s\n", 1193 "unable to allocate %i bytes for transfer buffer %i%s\n",
1194 sb_size, i, 1194 sb_size, i,
1195 in_interrupt() ? " while in int" : ""); 1195 in_interrupt() ? " while in int" : "");
@@ -1212,7 +1212,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
1212 rc = usb_submit_urb(dev->video_mode.bulk_ctl.urb[i], 1212 rc = usb_submit_urb(dev->video_mode.bulk_ctl.urb[i],
1213 GFP_ATOMIC); 1213 GFP_ATOMIC);
1214 if (rc) { 1214 if (rc) {
1215 dev_err(&dev->udev->dev, 1215 dev_err(dev->dev,
1216 "submit of urb %i failed (error=%i)\n", i, rc); 1216 "submit of urb %i failed (error=%i)\n", i, rc);
1217 cx231xx_uninit_bulk(dev); 1217 cx231xx_uninit_bulk(dev);
1218 return rc; 1218 return rc;
@@ -1316,7 +1316,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
1316 errCode = cx231xx_set_power_mode(dev, 1316 errCode = cx231xx_set_power_mode(dev,
1317 POLARIS_AVMODE_ENXTERNAL_AV); 1317 POLARIS_AVMODE_ENXTERNAL_AV);
1318 if (errCode < 0) { 1318 if (errCode < 0) {
1319 dev_err(&dev->udev->dev, 1319 dev_err(dev->dev,
1320 "%s: Failed to set Power - errCode [%d]!\n", 1320 "%s: Failed to set Power - errCode [%d]!\n",
1321 __func__, errCode); 1321 __func__, errCode);
1322 return errCode; 1322 return errCode;
@@ -1325,7 +1325,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
1325 errCode = cx231xx_set_power_mode(dev, 1325 errCode = cx231xx_set_power_mode(dev,
1326 POLARIS_AVMODE_ANALOGT_TV); 1326 POLARIS_AVMODE_ANALOGT_TV);
1327 if (errCode < 0) { 1327 if (errCode < 0) {
1328 dev_err(&dev->udev->dev, 1328 dev_err(dev->dev,
1329 "%s: Failed to set Power - errCode [%d]!\n", 1329 "%s: Failed to set Power - errCode [%d]!\n",
1330 __func__, errCode); 1330 __func__, errCode);
1331 return errCode; 1331 return errCode;
@@ -1340,14 +1340,14 @@ int cx231xx_dev_init(struct cx231xx *dev)
1340 /* initialize Colibri block */ 1340 /* initialize Colibri block */
1341 errCode = cx231xx_afe_init_super_block(dev, 0x23c); 1341 errCode = cx231xx_afe_init_super_block(dev, 0x23c);
1342 if (errCode < 0) { 1342 if (errCode < 0) {
1343 dev_err(&dev->udev->dev, 1343 dev_err(dev->dev,
1344 "%s: cx231xx_afe init super block - errCode [%d]!\n", 1344 "%s: cx231xx_afe init super block - errCode [%d]!\n",
1345 __func__, errCode); 1345 __func__, errCode);
1346 return errCode; 1346 return errCode;
1347 } 1347 }
1348 errCode = cx231xx_afe_init_channels(dev); 1348 errCode = cx231xx_afe_init_channels(dev);
1349 if (errCode < 0) { 1349 if (errCode < 0) {
1350 dev_err(&dev->udev->dev, 1350 dev_err(dev->dev,
1351 "%s: cx231xx_afe init channels - errCode [%d]!\n", 1351 "%s: cx231xx_afe init channels - errCode [%d]!\n",
1352 __func__, errCode); 1352 __func__, errCode);
1353 return errCode; 1353 return errCode;
@@ -1356,7 +1356,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
1356 /* Set DIF in By pass mode */ 1356 /* Set DIF in By pass mode */
1357 errCode = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND); 1357 errCode = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
1358 if (errCode < 0) { 1358 if (errCode < 0) {
1359 dev_err(&dev->udev->dev, 1359 dev_err(dev->dev,
1360 "%s: cx231xx_dif set to By pass mode - errCode [%d]!\n", 1360 "%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
1361 __func__, errCode); 1361 __func__, errCode);
1362 return errCode; 1362 return errCode;
@@ -1365,7 +1365,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
1365 /* I2S block related functions */ 1365 /* I2S block related functions */
1366 errCode = cx231xx_i2s_blk_initialize(dev); 1366 errCode = cx231xx_i2s_blk_initialize(dev);
1367 if (errCode < 0) { 1367 if (errCode < 0) {
1368 dev_err(&dev->udev->dev, 1368 dev_err(dev->dev,
1369 "%s: cx231xx_i2s block initialize - errCode [%d]!\n", 1369 "%s: cx231xx_i2s block initialize - errCode [%d]!\n",
1370 __func__, errCode); 1370 __func__, errCode);
1371 return errCode; 1371 return errCode;
@@ -1374,7 +1374,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
1374 /* init control pins */ 1374 /* init control pins */
1375 errCode = cx231xx_init_ctrl_pin_status(dev); 1375 errCode = cx231xx_init_ctrl_pin_status(dev);
1376 if (errCode < 0) { 1376 if (errCode < 0) {
1377 dev_err(&dev->udev->dev, 1377 dev_err(dev->dev,
1378 "%s: cx231xx_init ctrl pins - errCode [%d]!\n", 1378 "%s: cx231xx_init ctrl pins - errCode [%d]!\n",
1379 __func__, errCode); 1379 __func__, errCode);
1380 return errCode; 1380 return errCode;
@@ -1401,7 +1401,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
1401 break; 1401 break;
1402 } 1402 }
1403 if (errCode < 0) { 1403 if (errCode < 0) {
1404 dev_err(&dev->udev->dev, 1404 dev_err(dev->dev,
1405 "%s: cx231xx_AGC mode to Analog - errCode [%d]!\n", 1405 "%s: cx231xx_AGC mode to Analog - errCode [%d]!\n",
1406 __func__, errCode); 1406 __func__, errCode);
1407 return errCode; 1407 return errCode;
@@ -1478,7 +1478,7 @@ int cx231xx_send_gpio_cmd(struct cx231xx *dev, u32 gpio_bit, u8 *gpio_val,
1478 /* call common vendor command request */ 1478 /* call common vendor command request */
1479 status = cx231xx_send_vendor_cmd(dev, &ven_req); 1479 status = cx231xx_send_vendor_cmd(dev, &ven_req);
1480 if (status < 0) { 1480 if (status < 0) {
1481 dev_err(&dev->udev->dev, "%s: failed with status -%d\n", 1481 dev_err(dev->dev, "%s: failed with status -%d\n",
1482 __func__, status); 1482 __func__, status);
1483 } 1483 }
1484 1484
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index a0d40bda718d..dd600b994e69 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -191,10 +191,10 @@ static inline void print_err_status(struct cx231xx *dev, int packet, int status)
191 break; 191 break;
192 } 192 }
193 if (packet < 0) { 193 if (packet < 0) {
194 dev_dbg(&dev->udev->dev, 194 dev_dbg(dev->dev,
195 "URB status %d [%s].\n", status, errmsg); 195 "URB status %d [%s].\n", status, errmsg);
196 } else { 196 } else {
197 dev_dbg(&dev->udev->dev, 197 dev_dbg(dev->dev,
198 "URB packet %d, status %d [%s].\n", 198 "URB packet %d, status %d [%s].\n",
199 packet, status, errmsg); 199 packet, status, errmsg);
200 } 200 }
@@ -261,7 +261,7 @@ static int start_streaming(struct cx231xx_dvb *dvb)
261 struct cx231xx *dev = dvb->adapter.priv; 261 struct cx231xx *dev = dvb->adapter.priv;
262 262
263 if (dev->USE_ISO) { 263 if (dev->USE_ISO) {
264 dev_dbg(&dev->udev->dev, "DVB transfer mode is ISO.\n"); 264 dev_dbg(dev->dev, "DVB transfer mode is ISO.\n");
265 cx231xx_set_alt_setting(dev, INDEX_TS1, 4); 265 cx231xx_set_alt_setting(dev, INDEX_TS1, 4);
266 rc = cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE); 266 rc = cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE);
267 if (rc < 0) 267 if (rc < 0)
@@ -272,7 +272,7 @@ static int start_streaming(struct cx231xx_dvb *dvb)
272 dev->ts1_mode.max_pkt_size, 272 dev->ts1_mode.max_pkt_size,
273 dvb_isoc_copy); 273 dvb_isoc_copy);
274 } else { 274 } else {
275 dev_dbg(&dev->udev->dev, "DVB transfer mode is BULK.\n"); 275 dev_dbg(dev->dev, "DVB transfer mode is BULK.\n");
276 cx231xx_set_alt_setting(dev, INDEX_TS1, 0); 276 cx231xx_set_alt_setting(dev, INDEX_TS1, 0);
277 rc = cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE); 277 rc = cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE);
278 if (rc < 0) 278 if (rc < 0)
@@ -374,21 +374,20 @@ static int attach_xc5000(u8 addr, struct cx231xx *dev)
374 cfg.i2c_addr = addr; 374 cfg.i2c_addr = addr;
375 375
376 if (!dev->dvb->frontend) { 376 if (!dev->dvb->frontend) {
377 dev_err(&dev->udev->dev, "%s/2: dvb frontend not attached. " 377 dev_err(dev->dev, "%s/2: dvb frontend not attached. "
378 "Can't attach xc5000\n", dev->name); 378 "Can't attach xc5000\n", dev->name);
379 return -EINVAL; 379 return -EINVAL;
380 } 380 }
381 381
382 fe = dvb_attach(xc5000_attach, dev->dvb->frontend, &cfg); 382 fe = dvb_attach(xc5000_attach, dev->dvb->frontend, &cfg);
383 if (!fe) { 383 if (!fe) {
384 dev_err(&dev->udev->dev, 384 dev_err(dev->dev, "%s/2: xc5000 attach failed\n", dev->name);
385 "%s/2: xc5000 attach failed\n", dev->name);
386 dvb_frontend_detach(dev->dvb->frontend); 385 dvb_frontend_detach(dev->dvb->frontend);
387 dev->dvb->frontend = NULL; 386 dev->dvb->frontend = NULL;
388 return -EINVAL; 387 return -EINVAL;
389 } 388 }
390 389
391 dev_info(&dev->udev->dev, "%s/2: xc5000 attached\n", dev->name); 390 dev_info(dev->dev, "%s/2: xc5000 attached\n", dev->name);
392 391
393 return 0; 392 return 0;
394} 393}
@@ -427,16 +426,16 @@ int cx231xx_reset_analog_tuner(struct cx231xx *dev)
427 426
428 if (dops->init != NULL && !dev->xc_fw_load_done) { 427 if (dops->init != NULL && !dev->xc_fw_load_done) {
429 428
430 dev_dbg(&dev->udev->dev, 429 dev_dbg(dev->dev,
431 "Reloading firmware for XC5000\n"); 430 "Reloading firmware for XC5000\n");
432 status = dops->init(dev->dvb->frontend); 431 status = dops->init(dev->dvb->frontend);
433 if (status == 0) { 432 if (status == 0) {
434 dev->xc_fw_load_done = 1; 433 dev->xc_fw_load_done = 1;
435 dev_dbg(&dev->udev->dev, 434 dev_dbg(dev->dev,
436 "XC5000 firmware download completed\n"); 435 "XC5000 firmware download completed\n");
437 } else { 436 } else {
438 dev->xc_fw_load_done = 0; 437 dev->xc_fw_load_done = 0;
439 dev_dbg(&dev->udev->dev, 438 dev_dbg(dev->dev,
440 "XC5000 firmware download failed !!!\n"); 439 "XC5000 firmware download failed !!!\n");
441 } 440 }
442 } 441 }
@@ -460,7 +459,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
460 result = dvb_register_adapter(&dvb->adapter, dev->name, module, device, 459 result = dvb_register_adapter(&dvb->adapter, dev->name, module, device,
461 adapter_nr); 460 adapter_nr);
462 if (result < 0) { 461 if (result < 0) {
463 dev_warn(&dev->udev->dev, 462 dev_warn(dev->dev,
464 "%s: dvb_register_adapter failed (errno = %d)\n", 463 "%s: dvb_register_adapter failed (errno = %d)\n",
465 dev->name, result); 464 dev->name, result);
466 goto fail_adapter; 465 goto fail_adapter;
@@ -474,7 +473,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
474 /* register frontend */ 473 /* register frontend */
475 result = dvb_register_frontend(&dvb->adapter, dvb->frontend); 474 result = dvb_register_frontend(&dvb->adapter, dvb->frontend);
476 if (result < 0) { 475 if (result < 0) {
477 dev_warn(&dev->udev->dev, 476 dev_warn(dev->dev,
478 "%s: dvb_register_frontend failed (errno = %d)\n", 477 "%s: dvb_register_frontend failed (errno = %d)\n",
479 dev->name, result); 478 dev->name, result);
480 goto fail_frontend; 479 goto fail_frontend;
@@ -492,7 +491,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
492 491
493 result = dvb_dmx_init(&dvb->demux); 492 result = dvb_dmx_init(&dvb->demux);
494 if (result < 0) { 493 if (result < 0) {
495 dev_warn(&dev->udev->dev, 494 dev_warn(dev->dev,
496 "%s: dvb_dmx_init failed (errno = %d)\n", 495 "%s: dvb_dmx_init failed (errno = %d)\n",
497 dev->name, result); 496 dev->name, result);
498 goto fail_dmx; 497 goto fail_dmx;
@@ -503,7 +502,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
503 dvb->dmxdev.capabilities = 0; 502 dvb->dmxdev.capabilities = 0;
504 result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); 503 result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
505 if (result < 0) { 504 if (result < 0) {
506 dev_warn(&dev->udev->dev, 505 dev_warn(dev->dev,
507 "%s: dvb_dmxdev_init failed (errno = %d)\n", 506 "%s: dvb_dmxdev_init failed (errno = %d)\n",
508 dev->name, result); 507 dev->name, result);
509 goto fail_dmxdev; 508 goto fail_dmxdev;
@@ -512,7 +511,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
512 dvb->fe_hw.source = DMX_FRONTEND_0; 511 dvb->fe_hw.source = DMX_FRONTEND_0;
513 result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); 512 result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
514 if (result < 0) { 513 if (result < 0) {
515 dev_warn(&dev->udev->dev, 514 dev_warn(dev->dev,
516 "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", 515 "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
517 dev->name, result); 516 dev->name, result);
518 goto fail_fe_hw; 517 goto fail_fe_hw;
@@ -521,7 +520,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
521 dvb->fe_mem.source = DMX_MEMORY_FE; 520 dvb->fe_mem.source = DMX_MEMORY_FE;
522 result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); 521 result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
523 if (result < 0) { 522 if (result < 0) {
524 dev_warn(&dev->udev->dev, 523 dev_warn(dev->dev,
525 "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", 524 "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
526 dev->name, result); 525 dev->name, result);
527 goto fail_fe_mem; 526 goto fail_fe_mem;
@@ -529,7 +528,7 @@ static int register_dvb(struct cx231xx_dvb *dvb,
529 528
530 result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); 529 result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
531 if (result < 0) { 530 if (result < 0) {
532 dev_warn(&dev->udev->dev, 531 dev_warn(dev->dev,
533 "%s: connect_frontend failed (errno = %d)\n", 532 "%s: connect_frontend failed (errno = %d)\n",
534 dev->name, result); 533 dev->name, result);
535 goto fail_fe_conn; 534 goto fail_fe_conn;
@@ -590,7 +589,7 @@ static int dvb_init(struct cx231xx *dev)
590 dvb = kzalloc(sizeof(struct cx231xx_dvb), GFP_KERNEL); 589 dvb = kzalloc(sizeof(struct cx231xx_dvb), GFP_KERNEL);
591 590
592 if (dvb == NULL) { 591 if (dvb == NULL) {
593 dev_info(&dev->udev->dev, 592 dev_info(dev->dev,
594 "cx231xx_dvb: memory allocation failed\n"); 593 "cx231xx_dvb: memory allocation failed\n");
595 return -ENOMEM; 594 return -ENOMEM;
596 } 595 }
@@ -613,7 +612,7 @@ static int dvb_init(struct cx231xx *dev)
613 demod_i2c); 612 demod_i2c);
614 613
615 if (dev->dvb->frontend == NULL) { 614 if (dev->dvb->frontend == NULL) {
616 dev_err(&dev->udev->dev, 615 dev_err(dev->dev,
617 "Failed to attach s5h1432 front end\n"); 616 "Failed to attach s5h1432 front end\n");
618 result = -EINVAL; 617 result = -EINVAL;
619 goto out_free; 618 goto out_free;
@@ -638,7 +637,7 @@ static int dvb_init(struct cx231xx *dev)
638 demod_i2c); 637 demod_i2c);
639 638
640 if (dev->dvb->frontend == NULL) { 639 if (dev->dvb->frontend == NULL) {
641 dev_err(&dev->udev->dev, 640 dev_err(dev->dev,
642 "Failed to attach s5h1411 front end\n"); 641 "Failed to attach s5h1411 front end\n");
643 result = -EINVAL; 642 result = -EINVAL;
644 goto out_free; 643 goto out_free;
@@ -661,7 +660,7 @@ static int dvb_init(struct cx231xx *dev)
661 demod_i2c); 660 demod_i2c);
662 661
663 if (dev->dvb->frontend == NULL) { 662 if (dev->dvb->frontend == NULL) {
664 dev_err(&dev->udev->dev, 663 dev_err(dev->dev,
665 "Failed to attach s5h1432 front end\n"); 664 "Failed to attach s5h1432 front end\n");
666 result = -EINVAL; 665 result = -EINVAL;
667 goto out_free; 666 goto out_free;
@@ -685,7 +684,7 @@ static int dvb_init(struct cx231xx *dev)
685 demod_i2c); 684 demod_i2c);
686 685
687 if (dev->dvb->frontend == NULL) { 686 if (dev->dvb->frontend == NULL) {
688 dev_err(&dev->udev->dev, 687 dev_err(dev->dev,
689 "Failed to attach s5h1411 front end\n"); 688 "Failed to attach s5h1411 front end\n");
690 result = -EINVAL; 689 result = -EINVAL;
691 goto out_free; 690 goto out_free;
@@ -703,7 +702,7 @@ static int dvb_init(struct cx231xx *dev)
703 break; 702 break;
704 case CX231XX_BOARD_HAUPPAUGE_EXETER: 703 case CX231XX_BOARD_HAUPPAUGE_EXETER:
705 704
706 dev_info(&dev->udev->dev, 705 dev_info(dev->dev,
707 "%s: looking for tuner / demod on i2c bus: %d\n", 706 "%s: looking for tuner / demod on i2c bus: %d\n",
708 __func__, i2c_adapter_id(tuner_i2c)); 707 __func__, i2c_adapter_id(tuner_i2c));
709 708
@@ -712,7 +711,7 @@ static int dvb_init(struct cx231xx *dev)
712 tuner_i2c); 711 tuner_i2c);
713 712
714 if (dev->dvb->frontend == NULL) { 713 if (dev->dvb->frontend == NULL) {
715 dev_err(&dev->udev->dev, 714 dev_err(dev->dev,
716 "Failed to attach LG3305 front end\n"); 715 "Failed to attach LG3305 front end\n");
717 result = -EINVAL; 716 result = -EINVAL;
718 goto out_free; 717 goto out_free;
@@ -734,7 +733,7 @@ static int dvb_init(struct cx231xx *dev)
734 ); 733 );
735 734
736 if (dev->dvb->frontend == NULL) { 735 if (dev->dvb->frontend == NULL) {
737 dev_err(&dev->udev->dev, 736 dev_err(dev->dev,
738 "Failed to attach SI2165 front end\n"); 737 "Failed to attach SI2165 front end\n");
739 result = -EINVAL; 738 result = -EINVAL;
740 goto out_free; 739 goto out_free;
@@ -767,7 +766,7 @@ static int dvb_init(struct cx231xx *dev)
767 ); 766 );
768 767
769 if (dev->dvb->frontend == NULL) { 768 if (dev->dvb->frontend == NULL) {
770 dev_err(&dev->udev->dev, 769 dev_err(dev->dev,
771 "Failed to attach SI2165 front end\n"); 770 "Failed to attach SI2165 front end\n");
772 result = -EINVAL; 771 result = -EINVAL;
773 goto out_free; 772 goto out_free;
@@ -812,7 +811,7 @@ static int dvb_init(struct cx231xx *dev)
812 case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID: 811 case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID:
813 case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID: 812 case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID:
814 813
815 dev_info(&dev->udev->dev, 814 dev_info(dev->dev,
816 "%s: looking for demod on i2c bus: %d\n", 815 "%s: looking for demod on i2c bus: %d\n",
817 __func__, i2c_adapter_id(tuner_i2c)); 816 __func__, i2c_adapter_id(tuner_i2c));
818 817
@@ -821,7 +820,7 @@ static int dvb_init(struct cx231xx *dev)
821 demod_i2c); 820 demod_i2c);
822 821
823 if (dev->dvb->frontend == NULL) { 822 if (dev->dvb->frontend == NULL) {
824 dev_err(&dev->udev->dev, 823 dev_err(dev->dev,
825 "Failed to attach mb86a20s demod\n"); 824 "Failed to attach mb86a20s demod\n");
826 result = -EINVAL; 825 result = -EINVAL;
827 goto out_free; 826 goto out_free;
@@ -836,26 +835,26 @@ static int dvb_init(struct cx231xx *dev)
836 break; 835 break;
837 836
838 default: 837 default:
839 dev_err(&dev->udev->dev, 838 dev_err(dev->dev,
840 "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", 839 "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n",
841 dev->name); 840 dev->name);
842 break; 841 break;
843 } 842 }
844 if (NULL == dvb->frontend) { 843 if (NULL == dvb->frontend) {
845 dev_err(&dev->udev->dev, 844 dev_err(dev->dev,
846 "%s/2: frontend initialization failed\n", dev->name); 845 "%s/2: frontend initialization failed\n", dev->name);
847 result = -EINVAL; 846 result = -EINVAL;
848 goto out_free; 847 goto out_free;
849 } 848 }
850 849
851 /* register everything */ 850 /* register everything */
852 result = register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev); 851 result = register_dvb(dvb, THIS_MODULE, dev, dev->dev);
853 852
854 if (result < 0) 853 if (result < 0)
855 goto out_free; 854 goto out_free;
856 855
857 856
858 dev_info(&dev->udev->dev, "Successfully loaded cx231xx-dvb\n"); 857 dev_info(dev->dev, "Successfully loaded cx231xx-dvb\n");
859 858
860ret: 859ret:
861 cx231xx_set_mode(dev, CX231XX_SUSPEND); 860 cx231xx_set_mode(dev, CX231XX_SUSPEND);
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 7ccc33d33664..a29c345b027d 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -507,7 +507,7 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
507 rc = i2c_master_recv(&client, &buf, 0); 507 rc = i2c_master_recv(&client, &buf, 0);
508 if (rc < 0) 508 if (rc < 0)
509 continue; 509 continue;
510 dev_info(&dev->udev->dev, 510 dev_info(dev->dev,
511 "i2c scan: found device @ port %d addr 0x%x [%s]\n", 511 "i2c scan: found device @ port %d addr 0x%x [%s]\n",
512 i2c_port, 512 i2c_port,
513 i << 1, 513 i << 1,
@@ -528,7 +528,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
528 BUG_ON(!dev->cx231xx_send_usb_command); 528 BUG_ON(!dev->cx231xx_send_usb_command);
529 529
530 bus->i2c_adap = cx231xx_adap_template; 530 bus->i2c_adap = cx231xx_adap_template;
531 bus->i2c_adap.dev.parent = &dev->udev->dev; 531 bus->i2c_adap.dev.parent = dev->dev;
532 532
533 snprintf(bus->i2c_adap.name, sizeof(bus->i2c_adap.name), "%s-%d", bus->dev->name, bus->nr); 533 snprintf(bus->i2c_adap.name, sizeof(bus->i2c_adap.name), "%s-%d", bus->dev->name, bus->nr);
534 534
@@ -537,7 +537,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
537 i2c_add_adapter(&bus->i2c_adap); 537 i2c_add_adapter(&bus->i2c_adap);
538 538
539 if (0 != bus->i2c_rc) 539 if (0 != bus->i2c_rc)
540 dev_warn(&dev->udev->dev, 540 dev_warn(dev->dev,
541 "i2c bus %d register FAILED\n", bus->nr); 541 "i2c bus %d register FAILED\n", bus->nr);
542 542
543 return bus->i2c_rc; 543 return bus->i2c_rc;
@@ -569,7 +569,7 @@ int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
569{ 569{
570 struct i2c_adapter *i2c_parent = &dev->i2c_bus[1].i2c_adap; 570 struct i2c_adapter *i2c_parent = &dev->i2c_bus[1].i2c_adap;
571 /* what is the correct mux_dev? */ 571 /* what is the correct mux_dev? */
572 struct device *mux_dev = &dev->udev->dev; 572 struct device *mux_dev = dev->dev;
573 573
574 dev->i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent, 574 dev->i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent,
575 mux_dev, 575 mux_dev,
@@ -581,7 +581,7 @@ int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
581 NULL); 581 NULL);
582 582
583 if (!dev->i2c_mux_adap[mux_no]) 583 if (!dev->i2c_mux_adap[mux_no])
584 dev_warn(&dev->udev->dev, 584 dev_warn(dev->dev,
585 "i2c mux %d register FAILED\n", mux_no); 585 "i2c mux %d register FAILED\n", mux_no);
586 586
587 return 0; 587 return 0;
diff --git a/drivers/media/usb/cx231xx/cx231xx-input.c b/drivers/media/usb/cx231xx/cx231xx-input.c
index f954da6abf31..15d8d1b5f05c 100644
--- a/drivers/media/usb/cx231xx/cx231xx-input.c
+++ b/drivers/media/usb/cx231xx/cx231xx-input.c
@@ -62,7 +62,7 @@ int cx231xx_ir_init(struct cx231xx *dev)
62 struct i2c_board_info info; 62 struct i2c_board_info info;
63 u8 ir_i2c_bus; 63 u8 ir_i2c_bus;
64 64
65 dev_dbg(&dev->udev->dev, "%s\n", __func__); 65 dev_dbg(dev->dev, "%s\n", __func__);
66 66
67 /* Only initialize if a rc keycode map is defined */ 67 /* Only initialize if a rc keycode map is defined */
68 if (!cx231xx_boards[dev->model].rc_map_name) 68 if (!cx231xx_boards[dev->model].rc_map_name)
@@ -97,7 +97,7 @@ int cx231xx_ir_init(struct cx231xx *dev)
97 97
98 /* Load and bind ir-kbd-i2c */ 98 /* Load and bind ir-kbd-i2c */
99 ir_i2c_bus = cx231xx_boards[dev->model].ir_i2c_master; 99 ir_i2c_bus = cx231xx_boards[dev->model].ir_i2c_master;
100 dev_dbg(&dev->udev->dev, "Trying to bind ir at bus %d, addr 0x%02x\n", 100 dev_dbg(dev->dev, "Trying to bind ir at bus %d, addr 0x%02x\n",
101 ir_i2c_bus, info.addr); 101 ir_i2c_bus, info.addr);
102 dev->ir_i2c_client = i2c_new_device( 102 dev->ir_i2c_client = i2c_new_device(
103 cx231xx_get_i2c_adap(dev, ir_i2c_bus), &info); 103 cx231xx_get_i2c_adap(dev, ir_i2c_bus), &info);
diff --git a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c
index ee9d6225236a..5bc74149fcb9 100644
--- a/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c
+++ b/drivers/media/usb/cx231xx/cx231xx-pcb-cfg.c
@@ -703,7 +703,7 @@ int initialize_cx231xx(struct cx231xx *dev)
703 _current_scenario_idx = INDEX_BUSPOWER_DIF_ONLY; 703 _current_scenario_idx = INDEX_BUSPOWER_DIF_ONLY;
704 break; 704 break;
705 default: 705 default:
706 dev_err(&dev->udev->dev, 706 dev_err(dev->dev,
707 "bad config in buspower!!!!\nconfig_info=%x\n", 707 "bad config in buspower!!!!\nconfig_info=%x\n",
708 config_info & BUSPOWER_MASK); 708 config_info & BUSPOWER_MASK);
709 return 1; 709 return 1;
@@ -768,7 +768,7 @@ int initialize_cx231xx(struct cx231xx *dev)
768 _current_scenario_idx = INDEX_SELFPOWER_COMPRESSOR; 768 _current_scenario_idx = INDEX_SELFPOWER_COMPRESSOR;
769 break; 769 break;
770 default: 770 default:
771 dev_err(&dev->udev->dev, 771 dev_err(dev->dev,
772 "bad senario!!!!!\nconfig_info=%x\n", 772 "bad senario!!!!!\nconfig_info=%x\n",
773 config_info & SELFPOWER_MASK); 773 config_info & SELFPOWER_MASK);
774 return -ENODEV; 774 return -ENODEV;
@@ -781,27 +781,27 @@ int initialize_cx231xx(struct cx231xx *dev)
781 sizeof(struct pcb_config)); 781 sizeof(struct pcb_config));
782 782
783 if (pcb_debug) { 783 if (pcb_debug) {
784 dev_info(&dev->udev->dev, 784 dev_info(dev->dev,
785 "SC(0x00) register = 0x%x\n", config_info); 785 "SC(0x00) register = 0x%x\n", config_info);
786 dev_info(&dev->udev->dev, 786 dev_info(dev->dev,
787 "scenario %d\n", 787 "scenario %d\n",
788 (dev->current_pcb_config.index) + 1); 788 (dev->current_pcb_config.index) + 1);
789 dev_info(&dev->udev->dev, 789 dev_info(dev->dev,
790 "type=%x\n", 790 "type=%x\n",
791 dev->current_pcb_config.type); 791 dev->current_pcb_config.type);
792 dev_info(&dev->udev->dev, 792 dev_info(dev->dev,
793 "mode=%x\n", 793 "mode=%x\n",
794 dev->current_pcb_config.mode); 794 dev->current_pcb_config.mode);
795 dev_info(&dev->udev->dev, 795 dev_info(dev->dev,
796 "speed=%x\n", 796 "speed=%x\n",
797 dev->current_pcb_config.speed); 797 dev->current_pcb_config.speed);
798 dev_info(&dev->udev->dev, 798 dev_info(dev->dev,
799 "ts1_source=%x\n", 799 "ts1_source=%x\n",
800 dev->current_pcb_config.ts1_source); 800 dev->current_pcb_config.ts1_source);
801 dev_info(&dev->udev->dev, 801 dev_info(dev->dev,
802 "ts2_source=%x\n", 802 "ts2_source=%x\n",
803 dev->current_pcb_config.ts2_source); 803 dev->current_pcb_config.ts2_source);
804 dev_info(&dev->udev->dev, 804 dev_info(dev->dev,
805 "analog_source=%x\n", 805 "analog_source=%x\n",
806 dev->current_pcb_config.analog_source); 806 dev->current_pcb_config.analog_source);
807 } 807 }
diff --git a/drivers/media/usb/cx231xx/cx231xx-vbi.c b/drivers/media/usb/cx231xx/cx231xx-vbi.c
index 9a562c80e0b1..80261ac40208 100644
--- a/drivers/media/usb/cx231xx/cx231xx-vbi.c
+++ b/drivers/media/usb/cx231xx/cx231xx-vbi.c
@@ -68,10 +68,10 @@ static inline void print_err_status(struct cx231xx *dev, int packet, int status)
68 break; 68 break;
69 } 69 }
70 if (packet < 0) { 70 if (packet < 0) {
71 dev_err(&dev->udev->dev, 71 dev_err(dev->dev,
72 "URB status %d [%s].\n", status, errmsg); 72 "URB status %d [%s].\n", status, errmsg);
73 } else { 73 } else {
74 dev_err(&dev->udev->dev, 74 dev_err(dev->dev,
75 "URB packet %d, status %d [%s].\n", 75 "URB packet %d, status %d [%s].\n",
76 packet, status, errmsg); 76 packet, status, errmsg);
77 } 77 }
@@ -316,7 +316,7 @@ static void cx231xx_irq_vbi_callback(struct urb *urb)
316 case -ESHUTDOWN: 316 case -ESHUTDOWN:
317 return; 317 return;
318 default: /* error */ 318 default: /* error */
319 dev_err(&dev->udev->dev, 319 dev_err(dev->dev,
320 "urb completition error %d.\n", urb->status); 320 "urb completition error %d.\n", urb->status);
321 break; 321 break;
322 } 322 }
@@ -331,7 +331,7 @@ static void cx231xx_irq_vbi_callback(struct urb *urb)
331 331
332 urb->status = usb_submit_urb(urb, GFP_ATOMIC); 332 urb->status = usb_submit_urb(urb, GFP_ATOMIC);
333 if (urb->status) { 333 if (urb->status) {
334 dev_err(&dev->udev->dev, "urb resubmit failed (error=%i)\n", 334 dev_err(dev->dev, "urb resubmit failed (error=%i)\n",
335 urb->status); 335 urb->status);
336 } 336 }
337} 337}
@@ -344,7 +344,7 @@ void cx231xx_uninit_vbi_isoc(struct cx231xx *dev)
344 struct urb *urb; 344 struct urb *urb;
345 int i; 345 int i;
346 346
347 dev_dbg(&dev->udev->dev, "called cx231xx_uninit_vbi_isoc\n"); 347 dev_dbg(dev->dev, "called cx231xx_uninit_vbi_isoc\n");
348 348
349 dev->vbi_mode.bulk_ctl.nfields = -1; 349 dev->vbi_mode.bulk_ctl.nfields = -1;
350 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) { 350 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
@@ -393,7 +393,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
393 struct urb *urb; 393 struct urb *urb;
394 int rc; 394 int rc;
395 395
396 dev_dbg(&dev->udev->dev, "called cx231xx_vbi_isoc\n"); 396 dev_dbg(dev->dev, "called cx231xx_vbi_isoc\n");
397 397
398 /* De-allocates all pending stuff */ 398 /* De-allocates all pending stuff */
399 cx231xx_uninit_vbi_isoc(dev); 399 cx231xx_uninit_vbi_isoc(dev);
@@ -419,7 +419,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
419 dev->vbi_mode.bulk_ctl.urb = kzalloc(sizeof(void *) * num_bufs, 419 dev->vbi_mode.bulk_ctl.urb = kzalloc(sizeof(void *) * num_bufs,
420 GFP_KERNEL); 420 GFP_KERNEL);
421 if (!dev->vbi_mode.bulk_ctl.urb) { 421 if (!dev->vbi_mode.bulk_ctl.urb) {
422 dev_err(&dev->udev->dev, 422 dev_err(dev->dev,
423 "cannot alloc memory for usb buffers\n"); 423 "cannot alloc memory for usb buffers\n");
424 return -ENOMEM; 424 return -ENOMEM;
425 } 425 }
@@ -427,7 +427,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
427 dev->vbi_mode.bulk_ctl.transfer_buffer = 427 dev->vbi_mode.bulk_ctl.transfer_buffer =
428 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL); 428 kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
429 if (!dev->vbi_mode.bulk_ctl.transfer_buffer) { 429 if (!dev->vbi_mode.bulk_ctl.transfer_buffer) {
430 dev_err(&dev->udev->dev, 430 dev_err(dev->dev,
431 "cannot allocate memory for usbtransfer\n"); 431 "cannot allocate memory for usbtransfer\n");
432 kfree(dev->vbi_mode.bulk_ctl.urb); 432 kfree(dev->vbi_mode.bulk_ctl.urb);
433 return -ENOMEM; 433 return -ENOMEM;
@@ -443,7 +443,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
443 443
444 urb = usb_alloc_urb(0, GFP_KERNEL); 444 urb = usb_alloc_urb(0, GFP_KERNEL);
445 if (!urb) { 445 if (!urb) {
446 dev_err(&dev->udev->dev, 446 dev_err(dev->dev,
447 "cannot alloc bulk_ctl.urb %i\n", i); 447 "cannot alloc bulk_ctl.urb %i\n", i);
448 cx231xx_uninit_vbi_isoc(dev); 448 cx231xx_uninit_vbi_isoc(dev);
449 return -ENOMEM; 449 return -ENOMEM;
@@ -454,7 +454,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
454 dev->vbi_mode.bulk_ctl.transfer_buffer[i] = 454 dev->vbi_mode.bulk_ctl.transfer_buffer[i] =
455 kzalloc(sb_size, GFP_KERNEL); 455 kzalloc(sb_size, GFP_KERNEL);
456 if (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) { 456 if (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) {
457 dev_err(&dev->udev->dev, 457 dev_err(dev->dev,
458 "unable to allocate %i bytes for transfer buffer %i%s\n", 458 "unable to allocate %i bytes for transfer buffer %i%s\n",
459 sb_size, i, 459 sb_size, i,
460 in_interrupt() ? " while in int" : ""); 460 in_interrupt() ? " while in int" : "");
@@ -474,7 +474,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
474 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) { 474 for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
475 rc = usb_submit_urb(dev->vbi_mode.bulk_ctl.urb[i], GFP_ATOMIC); 475 rc = usb_submit_urb(dev->vbi_mode.bulk_ctl.urb[i], GFP_ATOMIC);
476 if (rc) { 476 if (rc) {
477 dev_err(&dev->udev->dev, 477 dev_err(dev->dev,
478 "submit of urb %i failed (error=%i)\n", i, rc); 478 "submit of urb %i failed (error=%i)\n", i, rc);
479 cx231xx_uninit_vbi_isoc(dev); 479 cx231xx_uninit_vbi_isoc(dev);
480 return rc; 480 return rc;
@@ -526,7 +526,7 @@ static inline void vbi_buffer_filled(struct cx231xx *dev,
526 struct cx231xx_buffer *buf) 526 struct cx231xx_buffer *buf)
527{ 527{
528 /* Advice that buffer was filled */ 528 /* Advice that buffer was filled */
529 /* dev_dbg(&dev->udev->dev, "[%p/%d] wakeup\n", buf, buf->vb.i); */ 529 /* dev_dbg(dev->dev, "[%p/%d] wakeup\n", buf, buf->vb.i); */
530 530
531 buf->vb.state = VIDEOBUF_DONE; 531 buf->vb.state = VIDEOBUF_DONE;
532 buf->vb.field_count++; 532 buf->vb.field_count++;
@@ -618,7 +618,7 @@ static inline void get_next_vbi_buf(struct cx231xx_dmaqueue *dma_q,
618 char *outp; 618 char *outp;
619 619
620 if (list_empty(&dma_q->active)) { 620 if (list_empty(&dma_q->active)) {
621 dev_err(&dev->udev->dev, "No active queue to serve\n"); 621 dev_err(dev->dev, "No active queue to serve\n");
622 dev->vbi_mode.bulk_ctl.buf = NULL; 622 dev->vbi_mode.bulk_ctl.buf = NULL;
623 *buf = NULL; 623 *buf = NULL;
624 return; 624 return;
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index c5b5e9541669..4c5bba2e89f4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -736,7 +736,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
736 if (!dev->video_mode.bulk_ctl.num_bufs) 736 if (!dev->video_mode.bulk_ctl.num_bufs)
737 urb_init = 1; 737 urb_init = 1;
738 } 738 }
739 dev_dbg(&dev->udev->dev, 739 dev_dbg(dev->dev,
740 "urb_init=%d dev->video_mode.max_pkt_size=%d\n", 740 "urb_init=%d dev->video_mode.max_pkt_size=%d\n",
741 urb_init, dev->video_mode.max_pkt_size); 741 urb_init, dev->video_mode.max_pkt_size);
742 if (urb_init) { 742 if (urb_init) {
@@ -809,7 +809,7 @@ void video_mux(struct cx231xx *dev, int index)
809 809
810 cx231xx_set_audio_input(dev, dev->ctl_ainput); 810 cx231xx_set_audio_input(dev, dev->ctl_ainput);
811 811
812 dev_dbg(&dev->udev->dev, "video_mux : %d\n", index); 812 dev_dbg(dev->dev, "video_mux : %d\n", index);
813 813
814 /* do mode control overrides if required */ 814 /* do mode control overrides if required */
815 cx231xx_do_mode_ctrl_overrides(dev); 815 cx231xx_do_mode_ctrl_overrides(dev);
@@ -861,7 +861,7 @@ static void res_free(struct cx231xx_fh *fh)
861static int check_dev(struct cx231xx *dev) 861static int check_dev(struct cx231xx *dev)
862{ 862{
863 if (dev->state & DEV_DISCONNECTED) { 863 if (dev->state & DEV_DISCONNECTED) {
864 dev_err(&dev->udev->dev, "v4l2 ioctl: device not present\n"); 864 dev_err(dev->dev, "v4l2 ioctl: device not present\n");
865 return -ENODEV; 865 return -ENODEV;
866 } 866 }
867 return 0; 867 return 0;
@@ -953,12 +953,12 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
953 return -EINVAL; 953 return -EINVAL;
954 954
955 if (videobuf_queue_is_busy(&fh->vb_vidq)) { 955 if (videobuf_queue_is_busy(&fh->vb_vidq)) {
956 dev_err(&dev->udev->dev, "%s: queue busy\n", __func__); 956 dev_err(dev->dev, "%s: queue busy\n", __func__);
957 return -EBUSY; 957 return -EBUSY;
958 } 958 }
959 959
960 if (dev->stream_on && !fh->stream_on) { 960 if (dev->stream_on && !fh->stream_on) {
961 dev_err(&dev->udev->dev, 961 dev_err(dev->dev,
962 "%s: device in use by another fh\n", __func__); 962 "%s: device in use by another fh\n", __func__);
963 return -EBUSY; 963 return -EBUSY;
964 } 964 }
@@ -1177,7 +1177,7 @@ int cx231xx_s_frequency(struct file *file, void *priv,
1177 int rc; 1177 int rc;
1178 u32 if_frequency = 5400000; 1178 u32 if_frequency = 5400000;
1179 1179
1180 dev_dbg(&dev->udev->dev, 1180 dev_dbg(dev->dev,
1181 "Enter vidioc_s_frequency()f->frequency=%d;f->type=%d\n", 1181 "Enter vidioc_s_frequency()f->frequency=%d;f->type=%d\n",
1182 f->frequency, f->type); 1182 f->frequency, f->type);
1183 1183
@@ -1214,14 +1214,14 @@ int cx231xx_s_frequency(struct file *file, void *priv,
1214 else if (dev->norm & V4L2_STD_SECAM_LC) 1214 else if (dev->norm & V4L2_STD_SECAM_LC)
1215 if_frequency = 1250000; /*1.25MHz */ 1215 if_frequency = 1250000; /*1.25MHz */
1216 1216
1217 dev_dbg(&dev->udev->dev, 1217 dev_dbg(dev->dev,
1218 "if_frequency is set to %d\n", if_frequency); 1218 "if_frequency is set to %d\n", if_frequency);
1219 cx231xx_set_Colibri_For_LowIF(dev, if_frequency, 1, 1); 1219 cx231xx_set_Colibri_For_LowIF(dev, if_frequency, 1, 1);
1220 1220
1221 update_HH_register_after_set_DIF(dev); 1221 update_HH_register_after_set_DIF(dev);
1222 } 1222 }
1223 1223
1224 dev_dbg(&dev->udev->dev, "Set New FREQUENCY to %d\n", f->frequency); 1224 dev_dbg(dev->dev, "Set New FREQUENCY to %d\n", f->frequency);
1225 1225
1226 return rc; 1226 return rc;
1227} 1227}
@@ -1525,7 +1525,7 @@ static int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,
1525 struct cx231xx *dev = fh->dev; 1525 struct cx231xx *dev = fh->dev;
1526 1526
1527 if (dev->vbi_stream_on && !fh->stream_on) { 1527 if (dev->vbi_stream_on && !fh->stream_on) {
1528 dev_err(&dev->udev->dev, 1528 dev_err(dev->dev,
1529 "%s device in use by another fh\n", __func__); 1529 "%s device in use by another fh\n", __func__);
1530 return -EBUSY; 1530 return -EBUSY;
1531 } 1531 }
@@ -1645,7 +1645,7 @@ static int cx231xx_v4l2_open(struct file *filp)
1645#if 0 1645#if 0
1646 errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE); 1646 errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
1647 if (errCode < 0) { 1647 if (errCode < 0) {
1648 dev_err(&dev->udev->dev, 1648 dev_err(dev->dev,
1649 "Device locked on digital mode. Can't open analog\n"); 1649 "Device locked on digital mode. Can't open analog\n");
1650 return -EBUSY; 1650 return -EBUSY;
1651 } 1651 }
@@ -1737,7 +1737,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
1737 dev->radio_dev = NULL; 1737 dev->radio_dev = NULL;
1738 } 1738 }
1739 if (dev->vbi_dev) { 1739 if (dev->vbi_dev) {
1740 dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", 1740 dev_info(dev->dev, "V4L2 device %s deregistered\n",
1741 video_device_node_name(dev->vbi_dev)); 1741 video_device_node_name(dev->vbi_dev));
1742 if (video_is_registered(dev->vbi_dev)) 1742 if (video_is_registered(dev->vbi_dev))
1743 video_unregister_device(dev->vbi_dev); 1743 video_unregister_device(dev->vbi_dev);
@@ -1746,7 +1746,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
1746 dev->vbi_dev = NULL; 1746 dev->vbi_dev = NULL;
1747 } 1747 }
1748 if (dev->vdev) { 1748 if (dev->vdev) {
1749 dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", 1749 dev_info(dev->dev, "V4L2 device %s deregistered\n",
1750 video_device_node_name(dev->vdev)); 1750 video_device_node_name(dev->vdev));
1751 1751
1752 if (dev->board.has_417) 1752 if (dev->board.has_417)
@@ -2081,7 +2081,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2081{ 2081{
2082 int ret; 2082 int ret;
2083 2083
2084 dev_info(&dev->udev->dev, "v4l2 driver version %s\n", CX231XX_VERSION); 2084 dev_info(dev->dev, "v4l2 driver version %s\n", CX231XX_VERSION);
2085 2085
2086 /* set default norm */ 2086 /* set default norm */
2087 dev->norm = V4L2_STD_PAL; 2087 dev->norm = V4L2_STD_PAL;
@@ -2119,7 +2119,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2119 /* allocate and fill video video_device struct */ 2119 /* allocate and fill video video_device struct */
2120 dev->vdev = cx231xx_vdev_init(dev, &cx231xx_video_template, "video"); 2120 dev->vdev = cx231xx_vdev_init(dev, &cx231xx_video_template, "video");
2121 if (!dev->vdev) { 2121 if (!dev->vdev) {
2122 dev_err(&dev->udev->dev, "cannot allocate video_device.\n"); 2122 dev_err(dev->dev, "cannot allocate video_device.\n");
2123 return -ENODEV; 2123 return -ENODEV;
2124 } 2124 }
2125 2125
@@ -2128,13 +2128,13 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2128 ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER, 2128 ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER,
2129 video_nr[dev->devno]); 2129 video_nr[dev->devno]);
2130 if (ret) { 2130 if (ret) {
2131 dev_err(&dev->udev->dev, 2131 dev_err(dev->dev,
2132 "unable to register video device (error=%i).\n", 2132 "unable to register video device (error=%i).\n",
2133 ret); 2133 ret);
2134 return ret; 2134 return ret;
2135 } 2135 }
2136 2136
2137 dev_info(&dev->udev->dev, "Registered video device %s [v4l2]\n", 2137 dev_info(dev->dev, "Registered video device %s [v4l2]\n",
2138 video_device_node_name(dev->vdev)); 2138 video_device_node_name(dev->vdev));
2139 2139
2140 /* Initialize VBI template */ 2140 /* Initialize VBI template */
@@ -2145,7 +2145,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2145 dev->vbi_dev = cx231xx_vdev_init(dev, &cx231xx_vbi_template, "vbi"); 2145 dev->vbi_dev = cx231xx_vdev_init(dev, &cx231xx_vbi_template, "vbi");
2146 2146
2147 if (!dev->vbi_dev) { 2147 if (!dev->vbi_dev) {
2148 dev_err(&dev->udev->dev, "cannot allocate video_device.\n"); 2148 dev_err(dev->dev, "cannot allocate video_device.\n");
2149 return -ENODEV; 2149 return -ENODEV;
2150 } 2150 }
2151 dev->vbi_dev->ctrl_handler = &dev->ctrl_handler; 2151 dev->vbi_dev->ctrl_handler = &dev->ctrl_handler;
@@ -2153,18 +2153,18 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2153 ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI, 2153 ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI,
2154 vbi_nr[dev->devno]); 2154 vbi_nr[dev->devno]);
2155 if (ret < 0) { 2155 if (ret < 0) {
2156 dev_err(&dev->udev->dev, "unable to register vbi device\n"); 2156 dev_err(dev->dev, "unable to register vbi device\n");
2157 return ret; 2157 return ret;
2158 } 2158 }
2159 2159
2160 dev_info(&dev->udev->dev, "Registered VBI device %s\n", 2160 dev_info(dev->dev, "Registered VBI device %s\n",
2161 video_device_node_name(dev->vbi_dev)); 2161 video_device_node_name(dev->vbi_dev));
2162 2162
2163 if (cx231xx_boards[dev->model].radio.type == CX231XX_RADIO) { 2163 if (cx231xx_boards[dev->model].radio.type == CX231XX_RADIO) {
2164 dev->radio_dev = cx231xx_vdev_init(dev, &cx231xx_radio_template, 2164 dev->radio_dev = cx231xx_vdev_init(dev, &cx231xx_radio_template,
2165 "radio"); 2165 "radio");
2166 if (!dev->radio_dev) { 2166 if (!dev->radio_dev) {
2167 dev_err(&dev->udev->dev, 2167 dev_err(dev->dev,
2168 "cannot allocate video_device.\n"); 2168 "cannot allocate video_device.\n");
2169 return -ENODEV; 2169 return -ENODEV;
2170 } 2170 }
@@ -2172,11 +2172,11 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
2172 ret = video_register_device(dev->radio_dev, VFL_TYPE_RADIO, 2172 ret = video_register_device(dev->radio_dev, VFL_TYPE_RADIO,
2173 radio_nr[dev->devno]); 2173 radio_nr[dev->devno]);
2174 if (ret < 0) { 2174 if (ret < 0) {
2175 dev_err(&dev->udev->dev, 2175 dev_err(dev->dev,
2176 "can't register radio device\n"); 2176 "can't register radio device\n");
2177 return ret; 2177 return ret;
2178 } 2178 }
2179 dev_info(&dev->udev->dev, "Registered radio device as %s\n", 2179 dev_info(dev->dev, "Registered radio device as %s\n",
2180 video_device_node_name(dev->radio_dev)); 2180 video_device_node_name(dev->radio_dev));
2181 } 2181 }
2182 2182
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index 1a850da4e8c0..f9e262eb0db9 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -597,6 +597,7 @@ struct cx231xx {
597 char name[30]; /* name (including minor) of the device */ 597 char name[30]; /* name (including minor) of the device */
598 int model; /* index in the device_data struct */ 598 int model; /* index in the device_data struct */
599 int devno; /* marks the number of this device */ 599 int devno; /* marks the number of this device */
600 struct device *dev; /* pointer to USB interface's dev */
600 601
601 struct cx231xx_board board; 602 struct cx231xx_board board;
602 603