aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/common/saa7146_fops.c4
-rw-r--r--drivers/media/common/saa7146_video.c12
-rw-r--r--drivers/media/dvb/frontends/s5h1411.c84
-rw-r--r--drivers/media/dvb/frontends/s5h1411.h2
-rw-r--r--drivers/media/radio/dsbr100.c62
-rw-r--r--drivers/media/radio/radio-mr800.c5
-rw-r--r--drivers/media/video/arv.c2
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c6
-rw-r--r--drivers/media/video/c-qcam.c2
-rw-r--r--drivers/media/video/cafe_ccic.c4
-rw-r--r--drivers/media/video/cpia.c6
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c2
-rw-r--r--drivers/media/video/cx18/cx18-driver.c11
-rw-r--r--drivers/media/video/cx18/cx18-io.h4
-rw-r--r--drivers/media/video/cx18/cx18-streams.c36
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c2
-rw-r--r--drivers/media/video/cx23885/cx23885-video.c2
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c2
-rw-r--r--drivers/media/video/cx88/cx88-cards.c4
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c11
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c2
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c15
-rw-r--r--drivers/media/video/cx88/cx88-video.c6
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c2
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c24
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c12
-rw-r--r--drivers/media/video/ivtv/ivtv-i2c.c1
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c13
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.h3
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c4
-rw-r--r--drivers/media/video/ivtv/ivtvfb.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-encoder.c4
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c17
-rw-r--r--drivers/media/video/pwc/pwc-if.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c2
-rw-r--r--drivers/media/video/se401.c2
-rw-r--r--drivers/media/video/sn9c102/sn9c102_core.c24
-rw-r--r--drivers/media/video/stk-webcam.c4
-rw-r--r--drivers/media/video/stv680.c3
-rw-r--r--drivers/media/video/usbvideo/usbvideo.c2
-rw-r--r--drivers/media/video/usbvideo/vicam.c3
-rw-r--r--drivers/media/video/usbvision/usbvision-i2c.c2
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c12
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c12
-rw-r--r--drivers/media/video/v4l1-compat.c221
-rw-r--r--drivers/media/video/v4l2-int-device.c5
-rw-r--r--drivers/media/video/v4l2-ioctl.c19
-rw-r--r--drivers/media/video/videobuf-dvb.c52
-rw-r--r--drivers/media/video/vivi.c6
-rw-r--r--drivers/media/video/w9968cf.c16
-rw-r--r--drivers/media/video/zc0301/zc0301_core.c24
-rw-r--r--drivers/media/video/zr364xx.c2
-rw-r--r--include/linux/videodev2.h7
-rw-r--r--include/media/v4l2-int-device.h28
-rw-r--r--include/media/v4l2-ioctl.h24
-rw-r--r--include/media/videobuf-dvb.h1
58 files changed, 495 insertions, 362 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index 5b34c134aa25..127b0526a727 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -545,11 +545,11 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
545 if( VFL_TYPE_GRABBER == type ) { 545 if( VFL_TYPE_GRABBER == type ) {
546 vv->video_minor = vfd->minor; 546 vv->video_minor = vfd->minor;
547 INFO(("%s: registered device video%d [v4l2]\n", 547 INFO(("%s: registered device video%d [v4l2]\n",
548 dev->name, vfd->minor & 0x1f)); 548 dev->name, vfd->num));
549 } else { 549 } else {
550 vv->vbi_minor = vfd->minor; 550 vv->vbi_minor = vfd->minor;
551 INFO(("%s: registered device vbi%d [v4l2]\n", 551 INFO(("%s: registered device vbi%d [v4l2]\n",
552 dev->name, vfd->minor & 0x1f)); 552 dev->name, vfd->num));
553 } 553 }
554 554
555 *vid = vfd; 555 *vid = vfd;
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
index 99be9e5c85f7..fe0bd55977e3 100644
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@ -834,7 +834,7 @@ static int video_end(struct saa7146_fh *fh, struct file *file)
834 * copying is done already, arg is a kernel pointer. 834 * copying is done already, arg is a kernel pointer.
835 */ 835 */
836 836
837int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg) 837static int __saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
838{ 838{
839 struct saa7146_fh *fh = file->private_data; 839 struct saa7146_fh *fh = file->private_data;
840 struct saa7146_dev *dev = fh->dev; 840 struct saa7146_dev *dev = fh->dev;
@@ -1215,12 +1215,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
1215 } 1215 }
1216#endif 1216#endif
1217 default: 1217 default:
1218 return v4l_compat_translate_ioctl(inode,file,cmd,arg, 1218 return v4l_compat_translate_ioctl(file, cmd, arg,
1219 saa7146_video_do_ioctl); 1219 __saa7146_video_do_ioctl);
1220 } 1220 }
1221 return 0; 1221 return 0;
1222} 1222}
1223 1223
1224int saa7146_video_do_ioctl(struct inode *inode, struct file *file,
1225 unsigned int cmd, void *arg)
1226{
1227 return __saa7146_video_do_ioctl(file, cmd, arg);
1228}
1229
1224/*********************************************************************************/ 1230/*********************************************************************************/
1225/* buffer handling functions */ 1231/* buffer handling functions */
1226 1232
diff --git a/drivers/media/dvb/frontends/s5h1411.c b/drivers/media/dvb/frontends/s5h1411.c
index 2febfb5a846b..40644aacffcb 100644
--- a/drivers/media/dvb/frontends/s5h1411.c
+++ b/drivers/media/dvb/frontends/s5h1411.c
@@ -38,6 +38,7 @@ struct s5h1411_state {
38 struct dvb_frontend frontend; 38 struct dvb_frontend frontend;
39 39
40 fe_modulation_t current_modulation; 40 fe_modulation_t current_modulation;
41 unsigned int first_tune:1;
41 42
42 u32 current_frequency; 43 u32 current_frequency;
43 int if_freq; 44 int if_freq;
@@ -62,7 +63,7 @@ static struct init_tab {
62 { S5H1411_I2C_TOP_ADDR, 0x08, 0x0047, }, 63 { S5H1411_I2C_TOP_ADDR, 0x08, 0x0047, },
63 { S5H1411_I2C_TOP_ADDR, 0x1c, 0x0400, }, 64 { S5H1411_I2C_TOP_ADDR, 0x1c, 0x0400, },
64 { S5H1411_I2C_TOP_ADDR, 0x1e, 0x0370, }, 65 { S5H1411_I2C_TOP_ADDR, 0x1e, 0x0370, },
65 { S5H1411_I2C_TOP_ADDR, 0x1f, 0x342a, }, 66 { S5H1411_I2C_TOP_ADDR, 0x1f, 0x342c, },
66 { S5H1411_I2C_TOP_ADDR, 0x24, 0x0231, }, 67 { S5H1411_I2C_TOP_ADDR, 0x24, 0x0231, },
67 { S5H1411_I2C_TOP_ADDR, 0x25, 0x1011, }, 68 { S5H1411_I2C_TOP_ADDR, 0x25, 0x1011, },
68 { S5H1411_I2C_TOP_ADDR, 0x26, 0x0f07, }, 69 { S5H1411_I2C_TOP_ADDR, 0x26, 0x0f07, },
@@ -100,7 +101,6 @@ static struct init_tab {
100 { S5H1411_I2C_TOP_ADDR, 0x78, 0x3141, }, 101 { S5H1411_I2C_TOP_ADDR, 0x78, 0x3141, },
101 { S5H1411_I2C_TOP_ADDR, 0x7a, 0x3141, }, 102 { S5H1411_I2C_TOP_ADDR, 0x7a, 0x3141, },
102 { S5H1411_I2C_TOP_ADDR, 0xb3, 0x8003, }, 103 { S5H1411_I2C_TOP_ADDR, 0xb3, 0x8003, },
103 { S5H1411_I2C_TOP_ADDR, 0xb5, 0xafbb, },
104 { S5H1411_I2C_TOP_ADDR, 0xb5, 0xa6bb, }, 104 { S5H1411_I2C_TOP_ADDR, 0xb5, 0xa6bb, },
105 { S5H1411_I2C_TOP_ADDR, 0xb6, 0x0609, }, 105 { S5H1411_I2C_TOP_ADDR, 0xb6, 0x0609, },
106 { S5H1411_I2C_TOP_ADDR, 0xb7, 0x2f06, }, 106 { S5H1411_I2C_TOP_ADDR, 0xb7, 0x2f06, },
@@ -393,7 +393,7 @@ static int s5h1411_set_if_freq(struct dvb_frontend *fe, int KHz)
393 393
394 switch (KHz) { 394 switch (KHz) {
395 case 3250: 395 case 3250:
396 s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x38, 0x10d9); 396 s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x38, 0x10d5);
397 s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x39, 0x5342); 397 s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x39, 0x5342);
398 s5h1411_writereg(state, S5H1411_I2C_QAM_ADDR, 0x2c, 0x10d9); 398 s5h1411_writereg(state, S5H1411_I2C_QAM_ADDR, 0x2c, 0x10d9);
399 break; 399 break;
@@ -464,13 +464,25 @@ static int s5h1411_set_spectralinversion(struct dvb_frontend *fe, int inversion)
464 464
465 if (inversion == 1) 465 if (inversion == 1)
466 val |= 0x1000; /* Inverted */ 466 val |= 0x1000; /* Inverted */
467 else
468 val |= 0x0000;
469 467
470 state->inversion = inversion; 468 state->inversion = inversion;
471 return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x24, val); 469 return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x24, val);
472} 470}
473 471
472static int s5h1411_set_serialmode(struct dvb_frontend *fe, int serial)
473{
474 struct s5h1411_state *state = fe->demodulator_priv;
475 u16 val;
476
477 dprintk("%s(%d)\n", __func__, serial);
478 val = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xbd) & ~0x100;
479
480 if (serial == 1)
481 val |= 0x100;
482
483 return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, val);
484}
485
474static int s5h1411_enable_modulation(struct dvb_frontend *fe, 486static int s5h1411_enable_modulation(struct dvb_frontend *fe,
475 fe_modulation_t m) 487 fe_modulation_t m)
476{ 488{
@@ -478,6 +490,12 @@ static int s5h1411_enable_modulation(struct dvb_frontend *fe,
478 490
479 dprintk("%s(0x%08x)\n", __func__, m); 491 dprintk("%s(0x%08x)\n", __func__, m);
480 492
493 if ((state->first_tune == 0) && (m == state->current_modulation)) {
494 dprintk("%s() Already at desired modulation. Skipping...\n",
495 __func__);
496 return 0;
497 }
498
481 switch (m) { 499 switch (m) {
482 case VSB_8: 500 case VSB_8:
483 dprintk("%s() VSB_8\n", __func__); 501 dprintk("%s() VSB_8\n", __func__);
@@ -502,6 +520,7 @@ static int s5h1411_enable_modulation(struct dvb_frontend *fe,
502 } 520 }
503 521
504 state->current_modulation = m; 522 state->current_modulation = m;
523 state->first_tune = 0;
505 s5h1411_softreset(fe); 524 s5h1411_softreset(fe);
506 525
507 return 0; 526 return 0;
@@ -535,7 +554,7 @@ static int s5h1411_set_gpio(struct dvb_frontend *fe, int enable)
535 return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xe0, val); 554 return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xe0, val);
536} 555}
537 556
538static int s5h1411_sleep(struct dvb_frontend *fe, int enable) 557static int s5h1411_set_powerstate(struct dvb_frontend *fe, int enable)
539{ 558{
540 struct s5h1411_state *state = fe->demodulator_priv; 559 struct s5h1411_state *state = fe->demodulator_priv;
541 560
@@ -551,6 +570,11 @@ static int s5h1411_sleep(struct dvb_frontend *fe, int enable)
551 return 0; 570 return 0;
552} 571}
553 572
573static int s5h1411_sleep(struct dvb_frontend *fe)
574{
575 return s5h1411_set_powerstate(fe, 1);
576}
577
554static int s5h1411_register_reset(struct dvb_frontend *fe) 578static int s5h1411_register_reset(struct dvb_frontend *fe)
555{ 579{
556 struct s5h1411_state *state = fe->demodulator_priv; 580 struct s5h1411_state *state = fe->demodulator_priv;
@@ -574,9 +598,6 @@ static int s5h1411_set_frontend(struct dvb_frontend *fe,
574 598
575 s5h1411_enable_modulation(fe, p->u.vsb.modulation); 599 s5h1411_enable_modulation(fe, p->u.vsb.modulation);
576 600
577 /* Allow the demod to settle */
578 msleep(100);
579
580 if (fe->ops.tuner_ops.set_params) { 601 if (fe->ops.tuner_ops.set_params) {
581 if (fe->ops.i2c_gate_ctrl) 602 if (fe->ops.i2c_gate_ctrl)
582 fe->ops.i2c_gate_ctrl(fe, 1); 603 fe->ops.i2c_gate_ctrl(fe, 1);
@@ -587,6 +608,10 @@ static int s5h1411_set_frontend(struct dvb_frontend *fe,
587 fe->ops.i2c_gate_ctrl(fe, 0); 608 fe->ops.i2c_gate_ctrl(fe, 0);
588 } 609 }
589 610
611 /* Issue a reset to the demod so it knows to resync against the
612 newly tuned frequency */
613 s5h1411_softreset(fe);
614
590 return 0; 615 return 0;
591} 616}
592 617
@@ -599,7 +624,7 @@ static int s5h1411_init(struct dvb_frontend *fe)
599 624
600 dprintk("%s()\n", __func__); 625 dprintk("%s()\n", __func__);
601 626
602 s5h1411_sleep(fe, 0); 627 s5h1411_set_powerstate(fe, 0);
603 s5h1411_register_reset(fe); 628 s5h1411_register_reset(fe);
604 629
605 for (i = 0; i < ARRAY_SIZE(init_tab); i++) 630 for (i = 0; i < ARRAY_SIZE(init_tab); i++)
@@ -610,12 +635,17 @@ static int s5h1411_init(struct dvb_frontend *fe)
610 /* The datasheet says that after initialisation, VSB is default */ 635 /* The datasheet says that after initialisation, VSB is default */
611 state->current_modulation = VSB_8; 636 state->current_modulation = VSB_8;
612 637
638 /* Although the datasheet says it's in VSB, empirical evidence
639 shows problems getting lock on the first tuning request. Make
640 sure we call enable_modulation the first time around */
641 state->first_tune = 1;
642
613 if (state->config->output_mode == S5H1411_SERIAL_OUTPUT) 643 if (state->config->output_mode == S5H1411_SERIAL_OUTPUT)
614 /* Serial */ 644 /* Serial */
615 s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, 0x1101); 645 s5h1411_set_serialmode(fe, 1);
616 else 646 else
617 /* Parallel */ 647 /* Parallel */
618 s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, 0x1001); 648 s5h1411_set_serialmode(fe, 0);
619 649
620 s5h1411_set_spectralinversion(fe, state->config->inversion); 650 s5h1411_set_spectralinversion(fe, state->config->inversion);
621 s5h1411_set_if_freq(fe, state->config->vsb_if); 651 s5h1411_set_if_freq(fe, state->config->vsb_if);
@@ -637,28 +667,29 @@ static int s5h1411_read_status(struct dvb_frontend *fe, fe_status_t *status)
637 667
638 *status = 0; 668 *status = 0;
639 669
640 /* Get the demodulator status */ 670 /* Register F2 bit 15 = Master Lock, removed */
641 reg = (s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2) >> 15)
642 & 0x0001;
643 if (reg)
644 *status |= FE_HAS_LOCK | FE_HAS_CARRIER | FE_HAS_SIGNAL;
645 671
646 switch (state->current_modulation) { 672 switch (state->current_modulation) {
647 case QAM_64: 673 case QAM_64:
648 case QAM_256: 674 case QAM_256:
649 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf0); 675 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf0);
650 if (reg & 0x100) 676 if (reg & 0x10) /* QAM FEC Lock */
651 *status |= FE_HAS_VITERBI; 677 *status |= FE_HAS_SYNC | FE_HAS_LOCK;
652 if (reg & 0x10) 678 if (reg & 0x100) /* QAM EQ Lock */
653 *status |= FE_HAS_SYNC; 679 *status |= FE_HAS_VITERBI | FE_HAS_CARRIER | FE_HAS_SIGNAL;
680
654 break; 681 break;
655 case VSB_8: 682 case VSB_8:
656 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0x5e);
657 if (reg & 0x0001)
658 *status |= FE_HAS_SYNC;
659 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2); 683 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2);
660 if (reg & 0x1000) 684 if (reg & 0x1000) /* FEC Lock */
661 *status |= FE_HAS_VITERBI; 685 *status |= FE_HAS_SYNC | FE_HAS_LOCK;
686 if (reg & 0x2000) /* EQ Lock */
687 *status |= FE_HAS_VITERBI | FE_HAS_CARRIER | FE_HAS_SIGNAL;
688
689 reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0x53);
690 if (reg & 0x1) /* AFC Lock */
691 *status |= FE_HAS_SIGNAL;
692
662 break; 693 break;
663 default: 694 default:
664 return -EINVAL; 695 return -EINVAL;
@@ -863,6 +894,7 @@ static struct dvb_frontend_ops s5h1411_ops = {
863 }, 894 },
864 895
865 .init = s5h1411_init, 896 .init = s5h1411_init,
897 .sleep = s5h1411_sleep,
866 .i2c_gate_ctrl = s5h1411_i2c_gate_ctrl, 898 .i2c_gate_ctrl = s5h1411_i2c_gate_ctrl,
867 .set_frontend = s5h1411_set_frontend, 899 .set_frontend = s5h1411_set_frontend,
868 .get_frontend = s5h1411_get_frontend, 900 .get_frontend = s5h1411_get_frontend,
diff --git a/drivers/media/dvb/frontends/s5h1411.h b/drivers/media/dvb/frontends/s5h1411.h
index 7d542bc00c48..45ec0f82989c 100644
--- a/drivers/media/dvb/frontends/s5h1411.h
+++ b/drivers/media/dvb/frontends/s5h1411.h
@@ -47,7 +47,7 @@ struct s5h1411_config {
47 u16 mpeg_timing; 47 u16 mpeg_timing;
48 48
49 /* IF Freq for QAM and VSB in KHz */ 49 /* IF Freq for QAM and VSB in KHz */
50#define S5H1411_IF_2500 2500 50#define S5H1411_IF_3250 3250
51#define S5H1411_IF_3500 3500 51#define S5H1411_IF_3500 3500
52#define S5H1411_IF_4000 4000 52#define S5H1411_IF_4000 4000
53#define S5H1411_IF_5380 5380 53#define S5H1411_IF_5380 5380
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 78f56944e640..a5ca176a7b08 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -171,11 +171,11 @@ static int dsbr100_start(struct dsbr100_device *radio)
171 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 171 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
172 USB_REQ_GET_STATUS, 172 USB_REQ_GET_STATUS,
173 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 173 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
174 0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 || 174 0x00, 0xC7, radio->transfer_buffer, 8, 300) < 0 ||
175 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 175 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
176 DSB100_ONOFF, 176 DSB100_ONOFF,
177 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 177 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
178 0x01, 0x00, radio->transfer_buffer, 8, 300)<0) 178 0x01, 0x00, radio->transfer_buffer, 8, 300) < 0)
179 return -1; 179 return -1;
180 radio->muted=0; 180 radio->muted=0;
181 return (radio->transfer_buffer)[0]; 181 return (radio->transfer_buffer)[0];
@@ -188,11 +188,11 @@ static int dsbr100_stop(struct dsbr100_device *radio)
188 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 188 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
189 USB_REQ_GET_STATUS, 189 USB_REQ_GET_STATUS,
190 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 190 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
191 0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 || 191 0x16, 0x1C, radio->transfer_buffer, 8, 300) < 0 ||
192 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 192 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
193 DSB100_ONOFF, 193 DSB100_ONOFF,
194 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 194 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
195 0x00, 0x00, radio->transfer_buffer, 8, 300)<0) 195 0x00, 0x00, radio->transfer_buffer, 8, 300) < 0)
196 return -1; 196 return -1;
197 radio->muted=1; 197 radio->muted=1;
198 return (radio->transfer_buffer)[0]; 198 return (radio->transfer_buffer)[0];
@@ -201,24 +201,24 @@ static int dsbr100_stop(struct dsbr100_device *radio)
201/* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */ 201/* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
202static int dsbr100_setfreq(struct dsbr100_device *radio, int freq) 202static int dsbr100_setfreq(struct dsbr100_device *radio, int freq)
203{ 203{
204 freq = (freq/16*80)/1000+856; 204 freq = (freq / 16 * 80) / 1000 + 856;
205 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 205 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
206 DSB100_TUNE, 206 DSB100_TUNE,
207 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 207 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
208 (freq>>8)&0x00ff, freq&0xff, 208 (freq >> 8) & 0x00ff, freq & 0xff,
209 radio->transfer_buffer, 8, 300)<0 || 209 radio->transfer_buffer, 8, 300) < 0 ||
210 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 210 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
211 USB_REQ_GET_STATUS, 211 USB_REQ_GET_STATUS,
212 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 212 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
213 0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 || 213 0x96, 0xB7, radio->transfer_buffer, 8, 300) < 0 ||
214 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 214 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
215 USB_REQ_GET_STATUS, 215 USB_REQ_GET_STATUS,
216 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 216 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
217 0x00, 0x24, radio->transfer_buffer, 8, 300)<0) { 217 0x00, 0x24, radio->transfer_buffer, 8, 300) < 0) {
218 radio->stereo = -1; 218 radio->stereo = -1;
219 return -1; 219 return -1;
220 } 220 }
221 radio->stereo = ! ((radio->transfer_buffer)[0]&0x01); 221 radio->stereo = !((radio->transfer_buffer)[0] & 0x01);
222 return (radio->transfer_buffer)[0]; 222 return (radio->transfer_buffer)[0];
223} 223}
224 224
@@ -229,10 +229,10 @@ static void dsbr100_getstat(struct dsbr100_device *radio)
229 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 229 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
230 USB_REQ_GET_STATUS, 230 USB_REQ_GET_STATUS,
231 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 231 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
232 0x00 , 0x24, radio->transfer_buffer, 8, 300)<0) 232 0x00 , 0x24, radio->transfer_buffer, 8, 300) < 0)
233 radio->stereo = -1; 233 radio->stereo = -1;
234 else 234 else
235 radio->stereo = ! (radio->transfer_buffer[0]&0x01); 235 radio->stereo = !(radio->transfer_buffer[0] & 0x01);
236} 236}
237 237
238 238
@@ -265,7 +265,7 @@ static int vidioc_querycap(struct file *file, void *priv,
265{ 265{
266 strlcpy(v->driver, "dsbr100", sizeof(v->driver)); 266 strlcpy(v->driver, "dsbr100", sizeof(v->driver));
267 strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card)); 267 strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card));
268 sprintf(v->bus_info, "ISA"); 268 sprintf(v->bus_info, "USB");
269 v->version = RADIO_VERSION; 269 v->version = RADIO_VERSION;
270 v->capabilities = V4L2_CAP_TUNER; 270 v->capabilities = V4L2_CAP_TUNER;
271 return 0; 271 return 0;
@@ -282,9 +282,9 @@ static int vidioc_g_tuner(struct file *file, void *priv,
282 dsbr100_getstat(radio); 282 dsbr100_getstat(radio);
283 strcpy(v->name, "FM"); 283 strcpy(v->name, "FM");
284 v->type = V4L2_TUNER_RADIO; 284 v->type = V4L2_TUNER_RADIO;
285 v->rangelow = FREQ_MIN*FREQ_MUL; 285 v->rangelow = FREQ_MIN * FREQ_MUL;
286 v->rangehigh = FREQ_MAX*FREQ_MUL; 286 v->rangehigh = FREQ_MAX * FREQ_MUL;
287 v->rxsubchans = V4L2_TUNER_SUB_MONO|V4L2_TUNER_SUB_STEREO; 287 v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
288 v->capability = V4L2_TUNER_CAP_LOW; 288 v->capability = V4L2_TUNER_CAP_LOW;
289 if(radio->stereo) 289 if(radio->stereo)
290 v->audmode = V4L2_TUNER_MODE_STEREO; 290 v->audmode = V4L2_TUNER_MODE_STEREO;
@@ -309,7 +309,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
309 struct dsbr100_device *radio = video_drvdata(file); 309 struct dsbr100_device *radio = video_drvdata(file);
310 310
311 radio->curfreq = f->frequency; 311 radio->curfreq = f->frequency;
312 if (dsbr100_setfreq(radio, radio->curfreq)==-1) 312 if (dsbr100_setfreq(radio, radio->curfreq) == -1)
313 dev_warn(&radio->usbdev->dev, "Set frequency failed\n"); 313 dev_warn(&radio->usbdev->dev, "Set frequency failed\n");
314 return 0; 314 return 0;
315} 315}
@@ -331,8 +331,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
331 331
332 for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) { 332 for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
333 if (qc->id && qc->id == radio_qctrl[i].id) { 333 if (qc->id && qc->id == radio_qctrl[i].id) {
334 memcpy(qc, &(radio_qctrl[i]), 334 memcpy(qc, &(radio_qctrl[i]), sizeof(*qc));
335 sizeof(*qc));
336 return 0; 335 return 0;
337 } 336 }
338 } 337 }
@@ -412,19 +411,25 @@ static int vidioc_s_audio(struct file *file, void *priv,
412static int usb_dsbr100_open(struct inode *inode, struct file *file) 411static int usb_dsbr100_open(struct inode *inode, struct file *file)
413{ 412{
414 struct dsbr100_device *radio = video_drvdata(file); 413 struct dsbr100_device *radio = video_drvdata(file);
414 int retval;
415 415
416 lock_kernel(); 416 lock_kernel();
417 radio->users = 1; 417 radio->users = 1;
418 radio->muted = 1; 418 radio->muted = 1;
419 419
420 if (dsbr100_start(radio)<0) { 420 if (dsbr100_start(radio) < 0) {
421 dev_warn(&radio->usbdev->dev, 421 dev_warn(&radio->usbdev->dev,
422 "Radio did not start up properly\n"); 422 "Radio did not start up properly\n");
423 radio->users = 0; 423 radio->users = 0;
424 unlock_kernel(); 424 unlock_kernel();
425 return -EIO; 425 return -EIO;
426 } 426 }
427 dsbr100_setfreq(radio, radio->curfreq); 427
428 retval = dsbr100_setfreq(radio, radio->curfreq);
429
430 if (retval == -1)
431 printk(KERN_WARNING KBUILD_MODNAME ": Set frequency failed\n");
432
428 unlock_kernel(); 433 unlock_kernel();
429 return 0; 434 return 0;
430} 435}
@@ -485,13 +490,20 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
485{ 490{
486 struct dsbr100_device *radio; 491 struct dsbr100_device *radio;
487 492
488 if (!(radio = kmalloc(sizeof(struct dsbr100_device), GFP_KERNEL))) 493 radio = kmalloc(sizeof(struct dsbr100_device), GFP_KERNEL);
494
495 if (!radio)
489 return -ENOMEM; 496 return -ENOMEM;
490 if (!(radio->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL))) { 497
498 radio->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL);
499
500 if (!(radio->transfer_buffer)) {
491 kfree(radio); 501 kfree(radio);
492 return -ENOMEM; 502 return -ENOMEM;
493 } 503 }
494 if (!(radio->videodev = video_device_alloc())) { 504 radio->videodev = video_device_alloc();
505
506 if (!(radio->videodev)) {
495 kfree(radio->transfer_buffer); 507 kfree(radio->transfer_buffer);
496 kfree(radio); 508 kfree(radio);
497 return -ENOMEM; 509 return -ENOMEM;
@@ -501,7 +513,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
501 radio->removed = 0; 513 radio->removed = 0;
502 radio->users = 0; 514 radio->users = 0;
503 radio->usbdev = interface_to_usbdev(intf); 515 radio->usbdev = interface_to_usbdev(intf);
504 radio->curfreq = FREQ_MIN*FREQ_MUL; 516 radio->curfreq = FREQ_MIN * FREQ_MUL;
505 video_set_drvdata(radio->videodev, radio); 517 video_set_drvdata(radio->videodev, radio);
506 if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) { 518 if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) {
507 dev_warn(&intf->dev, "Could not register video device\n"); 519 dev_warn(&intf->dev, "Could not register video device\n");
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index a33717c48003..256cbeffdcb6 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -469,16 +469,21 @@ static int usb_amradio_open(struct inode *inode, struct file *file)
469{ 469{
470 struct amradio_device *radio = video_get_drvdata(video_devdata(file)); 470 struct amradio_device *radio = video_get_drvdata(video_devdata(file));
471 471
472 lock_kernel();
473
472 radio->users = 1; 474 radio->users = 1;
473 radio->muted = 1; 475 radio->muted = 1;
474 476
475 if (amradio_start(radio) < 0) { 477 if (amradio_start(radio) < 0) {
476 warn("Radio did not start up properly"); 478 warn("Radio did not start up properly");
477 radio->users = 0; 479 radio->users = 0;
480 unlock_kernel();
478 return -EIO; 481 return -EIO;
479 } 482 }
480 if (amradio_setfreq(radio, radio->curfreq) < 0) 483 if (amradio_setfreq(radio, radio->curfreq) < 0)
481 warn("Set frequency failed"); 484 warn("Set frequency failed");
485
486 unlock_kernel();
482 return 0; 487 return 0;
483} 488}
484 489
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index 218754b4906a..e09b00693230 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -866,7 +866,7 @@ static int __init ar_init(void)
866 } 866 }
867 867
868 printk("video%d: Found M64278 VGA (IRQ %d, Freq %dMHz).\n", 868 printk("video%d: Found M64278 VGA (IRQ %d, Freq %dMHz).\n",
869 ar->vdev->minor, M32R_IRQ_INT3, freq); 869 ar->vdev->num, M32R_IRQ_INT3, freq);
870 870
871 return 0; 871 return 0;
872 872
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 5858bf5ff41c..9ec4cec2e52d 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -4246,7 +4246,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
4246 video_nr[btv->c.nr]) < 0) 4246 video_nr[btv->c.nr]) < 0)
4247 goto err; 4247 goto err;
4248 printk(KERN_INFO "bttv%d: registered device video%d\n", 4248 printk(KERN_INFO "bttv%d: registered device video%d\n",
4249 btv->c.nr,btv->video_dev->minor & 0x1f); 4249 btv->c.nr, btv->video_dev->num);
4250 if (device_create_file(&btv->video_dev->dev, 4250 if (device_create_file(&btv->video_dev->dev,
4251 &dev_attr_card)<0) { 4251 &dev_attr_card)<0) {
4252 printk(KERN_ERR "bttv%d: device_create_file 'card' " 4252 printk(KERN_ERR "bttv%d: device_create_file 'card' "
@@ -4263,7 +4263,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
4263 vbi_nr[btv->c.nr]) < 0) 4263 vbi_nr[btv->c.nr]) < 0)
4264 goto err; 4264 goto err;
4265 printk(KERN_INFO "bttv%d: registered device vbi%d\n", 4265 printk(KERN_INFO "bttv%d: registered device vbi%d\n",
4266 btv->c.nr,btv->vbi_dev->minor & 0x1f); 4266 btv->c.nr, btv->vbi_dev->num);
4267 4267
4268 if (!btv->has_radio) 4268 if (!btv->has_radio)
4269 return 0; 4269 return 0;
@@ -4275,7 +4275,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
4275 radio_nr[btv->c.nr]) < 0) 4275 radio_nr[btv->c.nr]) < 0)
4276 goto err; 4276 goto err;
4277 printk(KERN_INFO "bttv%d: registered device radio%d\n", 4277 printk(KERN_INFO "bttv%d: registered device radio%d\n",
4278 btv->c.nr,btv->radio_dev->minor & 0x1f); 4278 btv->c.nr, btv->radio_dev->num);
4279 4279
4280 /* all done */ 4280 /* all done */
4281 return 0; 4281 return 0;
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index 17aa0adb3467..0f930d351466 100644
--- a/drivers/media/video/c-qcam.c
+++ b/drivers/media/video/c-qcam.c
@@ -815,7 +815,7 @@ static int init_cqcam(struct parport *port)
815 } 815 }
816 816
817 printk(KERN_INFO "video%d: Colour QuickCam found on %s\n", 817 printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
818 qcam->vdev.minor, qcam->pport->name); 818 qcam->vdev.num, qcam->pport->name);
819 819
820 qcams[num_cams++] = qcam; 820 qcams[num_cams++] = qcam;
821 821
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index fc9497bdd322..a8c068e1de1c 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -2059,10 +2059,10 @@ static void cafe_dfs_cam_setup(struct cafe_camera *cam)
2059 2059
2060 if (!cafe_dfs_root) 2060 if (!cafe_dfs_root)
2061 return; 2061 return;
2062 sprintf(fname, "regs-%d", cam->v4ldev.minor); 2062 sprintf(fname, "regs-%d", cam->v4ldev.num);
2063 cam->dfs_regs = debugfs_create_file(fname, 0444, cafe_dfs_root, 2063 cam->dfs_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
2064 cam, &cafe_dfs_reg_ops); 2064 cam, &cafe_dfs_reg_ops);
2065 sprintf(fname, "cam-%d", cam->v4ldev.minor); 2065 sprintf(fname, "cam-%d", cam->v4ldev.num);
2066 cam->dfs_cam_regs = debugfs_create_file(fname, 0444, cafe_dfs_root, 2066 cam->dfs_cam_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
2067 cam, &cafe_dfs_cam_ops); 2067 cam, &cafe_dfs_cam_ops);
2068} 2068}
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 1798b779a25a..16c094f77852 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -1347,7 +1347,7 @@ static void create_proc_cpia_cam(struct cam_data *cam)
1347 if (!cpia_proc_root || !cam) 1347 if (!cpia_proc_root || !cam)
1348 return; 1348 return;
1349 1349
1350 snprintf(name, sizeof(name), "video%d", cam->vdev.minor); 1350 snprintf(name, sizeof(name), "video%d", cam->vdev.num);
1351 1351
1352 ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root); 1352 ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
1353 if (!ent) 1353 if (!ent)
@@ -1372,7 +1372,7 @@ static void destroy_proc_cpia_cam(struct cam_data *cam)
1372 if (!cam || !cam->proc_entry) 1372 if (!cam || !cam->proc_entry)
1373 return; 1373 return;
1374 1374
1375 snprintf(name, sizeof(name), "video%d", cam->vdev.minor); 1375 snprintf(name, sizeof(name), "video%d", cam->vdev.num);
1376 remove_proc_entry(name, cpia_proc_root); 1376 remove_proc_entry(name, cpia_proc_root);
1377 cam->proc_entry = NULL; 1377 cam->proc_entry = NULL;
1378} 1378}
@@ -4005,7 +4005,7 @@ void cpia_unregister_camera(struct cam_data *cam)
4005 } 4005 }
4006 4006
4007#ifdef CONFIG_PROC_FS 4007#ifdef CONFIG_PROC_FS
4008 DBG("destroying /proc/cpia/video%d\n", cam->vdev.minor); 4008 DBG("destroying /proc/cpia/video%d\n", cam->vdev.num);
4009 destroy_proc_cpia_cam(cam); 4009 destroy_proc_cpia_cam(cam);
4010#endif 4010#endif
4011 if (!cam->open_count) { 4011 if (!cam->open_count) {
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index 897e8d1a5c3c..1c6bd633f193 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -1973,7 +1973,7 @@ void cpia2_unregister_camera(struct camera_data *cam)
1973 } else { 1973 } else {
1974 LOG("/dev/video%d removed while open, " 1974 LOG("/dev/video%d removed while open, "
1975 "deferring video_unregister_device\n", 1975 "deferring video_unregister_device\n",
1976 cam->vdev->minor); 1976 cam->vdev->num);
1977 } 1977 }
1978} 1978}
1979 1979
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 085121c2b47f..7a1a7830a6b3 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -613,6 +613,7 @@ static int __devinit cx18_probe(struct pci_dev *dev,
613 const struct pci_device_id *pci_id) 613 const struct pci_device_id *pci_id)
614{ 614{
615 int retval = 0; 615 int retval = 0;
616 int i;
616 int vbi_buf_size; 617 int vbi_buf_size;
617 u32 devtype; 618 u32 devtype;
618 struct cx18 *cx; 619 struct cx18 *cx;
@@ -698,7 +699,8 @@ static int __devinit cx18_probe(struct pci_dev *dev,
698 699
699 /* active i2c */ 700 /* active i2c */
700 CX18_DEBUG_INFO("activating i2c...\n"); 701 CX18_DEBUG_INFO("activating i2c...\n");
701 if (init_cx18_i2c(cx)) { 702 retval = init_cx18_i2c(cx);
703 if (retval) {
702 CX18_ERR("Could not initialize i2c\n"); 704 CX18_ERR("Could not initialize i2c\n");
703 goto free_map; 705 goto free_map;
704 } 706 }
@@ -836,8 +838,11 @@ err:
836 CX18_ERR("Error %d on initialization\n", retval); 838 CX18_ERR("Error %d on initialization\n", retval);
837 cx18_log_statistics(cx); 839 cx18_log_statistics(cx);
838 840
839 kfree(cx18_cards[cx18_cards_active]); 841 i = cx->num;
840 cx18_cards[cx18_cards_active] = NULL; 842 spin_lock(&cx18_cards_lock);
843 kfree(cx18_cards[i]);
844 cx18_cards[i] = NULL;
845 spin_unlock(&cx18_cards_lock);
841 return retval; 846 return retval;
842} 847}
843 848
diff --git a/drivers/media/video/cx18/cx18-io.h b/drivers/media/video/cx18/cx18-io.h
index 197d4fbd9f95..287a5e8bf67b 100644
--- a/drivers/media/video/cx18/cx18-io.h
+++ b/drivers/media/video/cx18/cx18-io.h
@@ -39,7 +39,7 @@ static inline void cx18_io_delay(struct cx18 *cx)
39 39
40/* Statistics gathering */ 40/* Statistics gathering */
41static inline 41static inline
42void cx18_log_write_retries(struct cx18 *cx, int i, const void *addr) 42void cx18_log_write_retries(struct cx18 *cx, int i, const void __iomem *addr)
43{ 43{
44 if (i > CX18_MAX_MMIO_RETRIES) 44 if (i > CX18_MAX_MMIO_RETRIES)
45 i = CX18_MAX_MMIO_RETRIES; 45 i = CX18_MAX_MMIO_RETRIES;
@@ -48,7 +48,7 @@ void cx18_log_write_retries(struct cx18 *cx, int i, const void *addr)
48} 48}
49 49
50static inline 50static inline
51void cx18_log_read_retries(struct cx18 *cx, int i, const void *addr) 51void cx18_log_read_retries(struct cx18 *cx, int i, const void __iomem *addr)
52{ 52{
53 if (i > CX18_MAX_MMIO_RETRIES) 53 if (i > CX18_MAX_MMIO_RETRIES)
54 i = CX18_MAX_MMIO_RETRIES; 54 i = CX18_MAX_MMIO_RETRIES;
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index 0c8e7542cf60..e5ff7705b7a1 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -200,16 +200,18 @@ static int cx18_prep_dev(struct cx18 *cx, int type)
200/* Initialize v4l2 variables and register v4l2 devices */ 200/* Initialize v4l2 variables and register v4l2 devices */
201int cx18_streams_setup(struct cx18 *cx) 201int cx18_streams_setup(struct cx18 *cx)
202{ 202{
203 int type; 203 int type, ret;
204 204
205 /* Setup V4L2 Devices */ 205 /* Setup V4L2 Devices */
206 for (type = 0; type < CX18_MAX_STREAMS; type++) { 206 for (type = 0; type < CX18_MAX_STREAMS; type++) {
207 /* Prepare device */ 207 /* Prepare device */
208 if (cx18_prep_dev(cx, type)) 208 ret = cx18_prep_dev(cx, type);
209 if (ret < 0)
209 break; 210 break;
210 211
211 /* Allocate Stream */ 212 /* Allocate Stream */
212 if (cx18_stream_alloc(&cx->streams[type])) 213 ret = cx18_stream_alloc(&cx->streams[type]);
214 if (ret < 0)
213 break; 215 break;
214 } 216 }
215 if (type == CX18_MAX_STREAMS) 217 if (type == CX18_MAX_STREAMS)
@@ -217,14 +219,14 @@ int cx18_streams_setup(struct cx18 *cx)
217 219
218 /* One or more streams could not be initialized. Clean 'em all up. */ 220 /* One or more streams could not be initialized. Clean 'em all up. */
219 cx18_streams_cleanup(cx, 0); 221 cx18_streams_cleanup(cx, 0);
220 return -ENOMEM; 222 return ret;
221} 223}
222 224
223static int cx18_reg_dev(struct cx18 *cx, int type) 225static int cx18_reg_dev(struct cx18 *cx, int type)
224{ 226{
225 struct cx18_stream *s = &cx->streams[type]; 227 struct cx18_stream *s = &cx->streams[type];
226 int vfl_type = cx18_stream_info[type].vfl_type; 228 int vfl_type = cx18_stream_info[type].vfl_type;
227 int num; 229 int num, ret;
228 230
229 /* TODO: Shouldn't this be a VFL_TYPE_TRANSPORT or something? 231 /* TODO: Shouldn't this be a VFL_TYPE_TRANSPORT or something?
230 * We need a VFL_TYPE_TS defined. 232 * We need a VFL_TYPE_TS defined.
@@ -233,9 +235,10 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
233 /* just return if no DVB is supported */ 235 /* just return if no DVB is supported */
234 if ((cx->card->hw_all & CX18_HW_DVB) == 0) 236 if ((cx->card->hw_all & CX18_HW_DVB) == 0)
235 return 0; 237 return 0;
236 if (cx18_dvb_register(s) < 0) { 238 ret = cx18_dvb_register(s);
239 if (ret < 0) {
237 CX18_ERR("DVB failed to register\n"); 240 CX18_ERR("DVB failed to register\n");
238 return -EINVAL; 241 return ret;
239 } 242 }
240 } 243 }
241 244
@@ -252,12 +255,13 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
252 } 255 }
253 256
254 /* Register device. First try the desired minor, then any free one. */ 257 /* Register device. First try the desired minor, then any free one. */
255 if (video_register_device(s->v4l2dev, vfl_type, num)) { 258 ret = video_register_device(s->v4l2dev, vfl_type, num);
259 if (ret < 0) {
256 CX18_ERR("Couldn't register v4l2 device for %s kernel number %d\n", 260 CX18_ERR("Couldn't register v4l2 device for %s kernel number %d\n",
257 s->name, num); 261 s->name, num);
258 video_device_release(s->v4l2dev); 262 video_device_release(s->v4l2dev);
259 s->v4l2dev = NULL; 263 s->v4l2dev = NULL;
260 return -ENOMEM; 264 return ret;
261 } 265 }
262 num = s->v4l2dev->num; 266 num = s->v4l2dev->num;
263 267
@@ -290,18 +294,22 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
290int cx18_streams_register(struct cx18 *cx) 294int cx18_streams_register(struct cx18 *cx)
291{ 295{
292 int type; 296 int type;
293 int err = 0; 297 int err;
298 int ret = 0;
294 299
295 /* Register V4L2 devices */ 300 /* Register V4L2 devices */
296 for (type = 0; type < CX18_MAX_STREAMS; type++) 301 for (type = 0; type < CX18_MAX_STREAMS; type++) {
297 err |= cx18_reg_dev(cx, type); 302 err = cx18_reg_dev(cx, type);
303 if (err && ret == 0)
304 ret = err;
305 }
298 306
299 if (err == 0) 307 if (ret == 0)
300 return 0; 308 return 0;
301 309
302 /* One or more streams could not be initialized. Clean 'em all up. */ 310 /* One or more streams could not be initialized. Clean 'em all up. */
303 cx18_streams_cleanup(cx, 1); 311 cx18_streams_cleanup(cx, 1);
304 return -ENOMEM; 312 return ret;
305} 313}
306 314
307/* Unregister v4l2 devices */ 315/* Unregister v4l2 devices */
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index 395c11fa47ce..00831f3ef8f5 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -1815,7 +1815,7 @@ int cx23885_417_register(struct cx23885_dev *dev)
1815 cx23885_mc417_init(dev); 1815 cx23885_mc417_init(dev);
1816 1816
1817 printk(KERN_INFO "%s: registered device video%d [mpeg]\n", 1817 printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
1818 dev->name, dev->v4l_device->minor & 0x1f); 1818 dev->name, dev->v4l_device->num);
1819 1819
1820 return 0; 1820 return 0;
1821} 1821}
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index ab3110d6046c..c742a10be5cb 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -1543,7 +1543,7 @@ int cx23885_video_register(struct cx23885_dev *dev)
1543 goto fail_unreg; 1543 goto fail_unreg;
1544 } 1544 }
1545 printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n", 1545 printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
1546 dev->name, dev->video_dev->minor & 0x1f); 1546 dev->name, dev->video_dev->num);
1547 /* initial device configuration */ 1547 /* initial device configuration */
1548 mutex_lock(&dev->lock); 1548 mutex_lock(&dev->lock);
1549 cx23885_set_tvnorm(dev, dev->tvnorm); 1549 cx23885_set_tvnorm(dev, dev->tvnorm);
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index e71369754305..078be6319556 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1285,7 +1285,7 @@ static int blackbird_register_video(struct cx8802_dev *dev)
1285 return err; 1285 return err;
1286 } 1286 }
1287 printk(KERN_INFO "%s/2: registered device video%d [mpeg]\n", 1287 printk(KERN_INFO "%s/2: registered device video%d [mpeg]\n",
1288 dev->core->name,dev->mpeg_dev->minor & 0x1f); 1288 dev->core->name, dev->mpeg_dev->num);
1289 return 0; 1289 return 0;
1290} 1290}
1291 1291
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index fbc224f46e0e..5bcbb4cc7c2a 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -3044,8 +3044,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
3044 3044
3045 memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board)); 3045 memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
3046 3046
3047 if (!core->board.num_frontends) 3047 if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB))
3048 core->board.num_frontends=1; 3048 core->board.num_frontends = 1;
3049 3049
3050 info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n", 3050 info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n",
3051 pci->subsystem_vendor, pci->subsystem_device, core->board.name, 3051 pci->subsystem_vendor, pci->subsystem_device, core->board.name,
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 6968ab0181aa..cf6c30d4e545 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -789,7 +789,7 @@ static int dvb_register(struct cx8802_dev *dev)
789 if (fe0->dvb.frontend) 789 if (fe0->dvb.frontend)
790 fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL; 790 fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
791 if (attach_xc3028(0x61, dev) < 0) 791 if (attach_xc3028(0x61, dev) < 0)
792 return -EINVAL; 792 goto frontend_detach;
793 break; 793 break;
794 case CX88_BOARD_PCHDTV_HD3000: 794 case CX88_BOARD_PCHDTV_HD3000:
795 fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, 795 fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000,
@@ -1058,7 +1058,6 @@ static int dvb_register(struct cx8802_dev *dev)
1058 goto frontend_detach; 1058 goto frontend_detach;
1059 core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage; 1059 core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
1060 fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage; 1060 fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
1061
1062 } 1061 }
1063 } 1062 }
1064 break; 1063 break;
@@ -1110,10 +1109,7 @@ static int dvb_register(struct cx8802_dev *dev)
1110 &dev->pci->dev, adapter_nr, mfe_shared); 1109 &dev->pci->dev, adapter_nr, mfe_shared);
1111 1110
1112frontend_detach: 1111frontend_detach:
1113 if (fe0->dvb.frontend) { 1112 videobuf_dvb_dealloc_frontends(&dev->frontends);
1114 dvb_frontend_detach(fe0->dvb.frontend);
1115 fe0->dvb.frontend = NULL;
1116 }
1117 return -EINVAL; 1113 return -EINVAL;
1118} 1114}
1119 1115
@@ -1246,8 +1242,11 @@ fail_core:
1246 1242
1247static int cx8802_dvb_remove(struct cx8802_driver *drv) 1243static int cx8802_dvb_remove(struct cx8802_driver *drv)
1248{ 1244{
1245 struct cx88_core *core = drv->core;
1249 struct cx8802_dev *dev = drv->core->dvbdev; 1246 struct cx8802_dev *dev = drv->core->dvbdev;
1250 1247
1248 dprintk( 1, "%s\n", __func__);
1249
1251 videobuf_dvb_unregister_bus(&dev->frontends); 1250 videobuf_dvb_unregister_bus(&dev->frontends);
1252 1251
1253 vp3054_i2c_remove(dev); 1252 vp3054_i2c_remove(dev);
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 01de23007095..1ab691d20692 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -116,8 +116,10 @@ static int detach_inform(struct i2c_client *client)
116 116
117void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg) 117void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
118{ 118{
119#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
119 struct videobuf_dvb_frontends *f = &core->dvbdev->frontends; 120 struct videobuf_dvb_frontends *f = &core->dvbdev->frontends;
120 struct videobuf_dvb_frontend *fe = NULL; 121 struct videobuf_dvb_frontend *fe = NULL;
122#endif
121 if (0 != core->i2c_rc) 123 if (0 != core->i2c_rc)
122 return; 124 return;
123 125
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 6df5cf314186..a1c435b4b1cd 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -768,8 +768,11 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
768{ 768{
769 struct cx8802_dev *dev; 769 struct cx8802_dev *dev;
770 struct cx88_core *core; 770 struct cx88_core *core;
771 int err;
772#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
771 struct videobuf_dvb_frontend *demod; 773 struct videobuf_dvb_frontend *demod;
772 int err,i; 774 int i;
775#endif
773 776
774 /* general setup */ 777 /* general setup */
775 core = cx88_core_get(pci_dev); 778 core = cx88_core_get(pci_dev);
@@ -782,11 +785,6 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
782 if (!core->board.mpeg) 785 if (!core->board.mpeg)
783 goto fail_core; 786 goto fail_core;
784 787
785 if (!core->board.num_frontends) {
786 printk(KERN_ERR "%s() .num_frontends should be non-zero, err = %d\n", __func__, err);
787 goto fail_core;
788 }
789
790 err = -ENOMEM; 788 err = -ENOMEM;
791 dev = kzalloc(sizeof(*dev),GFP_KERNEL); 789 dev = kzalloc(sizeof(*dev),GFP_KERNEL);
792 if (NULL == dev) 790 if (NULL == dev)
@@ -801,10 +799,12 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
801 INIT_LIST_HEAD(&dev->drvlist); 799 INIT_LIST_HEAD(&dev->drvlist);
802 list_add_tail(&dev->devlist,&cx8802_devlist); 800 list_add_tail(&dev->devlist,&cx8802_devlist);
803 801
802#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
804 mutex_init(&dev->frontends.lock); 803 mutex_init(&dev->frontends.lock);
805 INIT_LIST_HEAD(&dev->frontends.felist); 804 INIT_LIST_HEAD(&dev->frontends.felist);
806 805
807 printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends); 806 if (core->board.num_frontends)
807 printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends);
808 808
809 for (i = 1; i <= core->board.num_frontends; i++) { 809 for (i = 1; i <= core->board.num_frontends; i++) {
810 demod = videobuf_dvb_alloc_frontend(&dev->frontends, i); 810 demod = videobuf_dvb_alloc_frontend(&dev->frontends, i);
@@ -814,6 +814,7 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
814 goto fail_free; 814 goto fail_free;
815 } 815 }
816 } 816 }
817#endif
817 818
818 /* Maintain a reference so cx88-video can query the 8802 device. */ 819 /* Maintain a reference so cx88-video can query the 8802 device. */
819 core->dvbdev = dev; 820 core->dvbdev = dev;
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 3904b73f52ee..61265fd04d56 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1911,7 +1911,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1911 goto fail_unreg; 1911 goto fail_unreg;
1912 } 1912 }
1913 printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n", 1913 printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
1914 core->name,dev->video_dev->minor & 0x1f); 1914 core->name, dev->video_dev->num);
1915 1915
1916 dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi"); 1916 dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi");
1917 err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI, 1917 err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
@@ -1922,7 +1922,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1922 goto fail_unreg; 1922 goto fail_unreg;
1923 } 1923 }
1924 printk(KERN_INFO "%s/0: registered device vbi%d\n", 1924 printk(KERN_INFO "%s/0: registered device vbi%d\n",
1925 core->name,dev->vbi_dev->minor & 0x1f); 1925 core->name, dev->vbi_dev->num);
1926 1926
1927 if (core->board.radio.type == CX88_RADIO) { 1927 if (core->board.radio.type == CX88_RADIO) {
1928 dev->radio_dev = cx88_vdev_init(core,dev->pci, 1928 dev->radio_dev = cx88_vdev_init(core,dev->pci,
@@ -1935,7 +1935,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1935 goto fail_unreg; 1935 goto fail_unreg;
1936 } 1936 }
1937 printk(KERN_INFO "%s/0: registered device radio%d\n", 1937 printk(KERN_INFO "%s/0: registered device radio%d\n",
1938 core->name,dev->radio_dev->minor & 0x1f); 1938 core->name, dev->radio_dev->num);
1939 } 1939 }
1940 1940
1941 /* everything worked */ 1941 /* everything worked */
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index c53649e5315b..a1ab2ef45578 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -2042,7 +2042,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
2042 goto fail_unreg; 2042 goto fail_unreg;
2043 } 2043 }
2044 em28xx_info("Registered radio device as /dev/radio%d\n", 2044 em28xx_info("Registered radio device as /dev/radio%d\n",
2045 dev->radio_dev->minor & 0x1f); 2045 dev->radio_dev->num);
2046 } 2046 }
2047 2047
2048 /* init video dma queues */ 2048 /* init video dma queues */
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index 7a85c41b0eea..9d0ef96c23ff 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -588,7 +588,7 @@ static int et61x251_stream_interrupt(struct et61x251_device* cam)
588 cam->state |= DEV_MISCONFIGURED; 588 cam->state |= DEV_MISCONFIGURED;
589 DBG(1, "URB timeout reached. The camera is misconfigured. To " 589 DBG(1, "URB timeout reached. The camera is misconfigured. To "
590 "use it, close and open /dev/video%d again.", 590 "use it, close and open /dev/video%d again.",
591 cam->v4ldev->minor); 591 cam->v4ldev->num);
592 return -EIO; 592 return -EIO;
593 } 593 }
594 594
@@ -1195,7 +1195,7 @@ static void et61x251_release_resources(struct kref *kref)
1195 1195
1196 cam = container_of(kref, struct et61x251_device, kref); 1196 cam = container_of(kref, struct et61x251_device, kref);
1197 1197
1198 DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor); 1198 DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
1199 video_set_drvdata(cam->v4ldev, NULL); 1199 video_set_drvdata(cam->v4ldev, NULL);
1200 video_unregister_device(cam->v4ldev); 1200 video_unregister_device(cam->v4ldev);
1201 usb_put_dev(cam->usbdev); 1201 usb_put_dev(cam->usbdev);
@@ -1237,7 +1237,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
1237 1237
1238 if (cam->users) { 1238 if (cam->users) {
1239 DBG(2, "Device /dev/video%d is already in use", 1239 DBG(2, "Device /dev/video%d is already in use",
1240 cam->v4ldev->minor); 1240 cam->v4ldev->num);
1241 DBG(3, "Simultaneous opens are not supported"); 1241 DBG(3, "Simultaneous opens are not supported");
1242 if ((filp->f_flags & O_NONBLOCK) || 1242 if ((filp->f_flags & O_NONBLOCK) ||
1243 (filp->f_flags & O_NDELAY)) { 1243 (filp->f_flags & O_NDELAY)) {
@@ -1280,7 +1280,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
1280 cam->frame_count = 0; 1280 cam->frame_count = 0;
1281 et61x251_empty_framequeues(cam); 1281 et61x251_empty_framequeues(cam);
1282 1282
1283 DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor); 1283 DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
1284 1284
1285out: 1285out:
1286 mutex_unlock(&cam->open_mutex); 1286 mutex_unlock(&cam->open_mutex);
@@ -1304,7 +1304,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
1304 cam->users--; 1304 cam->users--;
1305 wake_up_interruptible_nr(&cam->wait_open, 1); 1305 wake_up_interruptible_nr(&cam->wait_open, 1);
1306 1306
1307 DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor); 1307 DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
1308 1308
1309 kref_put(&cam->kref, et61x251_release_resources); 1309 kref_put(&cam->kref, et61x251_release_resources);
1310 1310
@@ -1845,7 +1845,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
1845 cam->state |= DEV_MISCONFIGURED; 1845 cam->state |= DEV_MISCONFIGURED;
1846 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " 1846 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
1847 "use the camera, close and open /dev/video%d again.", 1847 "use the camera, close and open /dev/video%d again.",
1848 cam->v4ldev->minor); 1848 cam->v4ldev->num);
1849 return -EIO; 1849 return -EIO;
1850 } 1850 }
1851 1851
@@ -1858,7 +1858,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
1858 cam->state |= DEV_MISCONFIGURED; 1858 cam->state |= DEV_MISCONFIGURED;
1859 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " 1859 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
1860 "use the camera, close and open /dev/video%d again.", 1860 "use the camera, close and open /dev/video%d again.",
1861 cam->v4ldev->minor); 1861 cam->v4ldev->num);
1862 return -ENOMEM; 1862 return -ENOMEM;
1863 } 1863 }
1864 1864
@@ -2068,7 +2068,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
2068 cam->state |= DEV_MISCONFIGURED; 2068 cam->state |= DEV_MISCONFIGURED;
2069 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " 2069 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
2070 "use the camera, close and open /dev/video%d again.", 2070 "use the camera, close and open /dev/video%d again.",
2071 cam->v4ldev->minor); 2071 cam->v4ldev->num);
2072 return -EIO; 2072 return -EIO;
2073 } 2073 }
2074 2074
@@ -2080,7 +2080,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
2080 cam->state |= DEV_MISCONFIGURED; 2080 cam->state |= DEV_MISCONFIGURED;
2081 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " 2081 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
2082 "use the camera, close and open /dev/video%d again.", 2082 "use the camera, close and open /dev/video%d again.",
2083 cam->v4ldev->minor); 2083 cam->v4ldev->num);
2084 return -ENOMEM; 2084 return -ENOMEM;
2085 } 2085 }
2086 2086
@@ -2128,7 +2128,7 @@ et61x251_vidioc_s_jpegcomp(struct et61x251_device* cam, void __user * arg)
2128 cam->state |= DEV_MISCONFIGURED; 2128 cam->state |= DEV_MISCONFIGURED;
2129 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " 2129 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
2130 "problems. To use the camera, close and open " 2130 "problems. To use the camera, close and open "
2131 "/dev/video%d again.", cam->v4ldev->minor); 2131 "/dev/video%d again.", cam->v4ldev->num);
2132 return -EIO; 2132 return -EIO;
2133 } 2133 }
2134 2134
@@ -2605,7 +2605,7 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2605 goto fail; 2605 goto fail;
2606 } 2606 }
2607 2607
2608 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor); 2608 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
2609 2609
2610 cam->module_param.force_munmap = force_munmap[dev_nr]; 2610 cam->module_param.force_munmap = force_munmap[dev_nr];
2611 cam->module_param.frame_timeout = frame_timeout[dev_nr]; 2611 cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2658,7 +2658,7 @@ static void et61x251_usb_disconnect(struct usb_interface* intf)
2658 if (cam->users) { 2658 if (cam->users) {
2659 DBG(2, "Device /dev/video%d is open! Deregistration and " 2659 DBG(2, "Device /dev/video%d is open! Deregistration and "
2660 "memory deallocation are deferred.", 2660 "memory deallocation are deferred.",
2661 cam->v4ldev->minor); 2661 cam->v4ldev->num);
2662 cam->state |= DEV_MISCONFIGURED; 2662 cam->state |= DEV_MISCONFIGURED;
2663 et61x251_stop_transfer(cam); 2663 et61x251_stop_transfer(cam);
2664 cam->state |= DEV_DISCONNECTED; 2664 cam->state |= DEV_DISCONNECTED;
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index aeaa13f6cb36..d36485023b68 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -1211,6 +1211,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
1211 1211
1212 if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) { 1212 if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
1213 ivtv_call_i2c_clients(itv, VIDIOC_INT_S_STD_OUTPUT, &itv->std); 1213 ivtv_call_i2c_clients(itv, VIDIOC_INT_S_STD_OUTPUT, &itv->std);
1214 /* Turn off the output signal. The mpeg decoder is not yet
1215 active so without this you would get a green image until the
1216 mpeg decoder becomes active. */
1217 ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
1214 } 1218 }
1215 1219
1216 /* clear interrupt mask, effectively disabling interrupts */ 1220 /* clear interrupt mask, effectively disabling interrupts */
@@ -1330,6 +1334,10 @@ int ivtv_init_on_first_open(struct ivtv *itv)
1330 ivtv_s_frequency(NULL, &fh, &vf); 1334 ivtv_s_frequency(NULL, &fh, &vf);
1331 1335
1332 if (itv->card->v4l2_capabilities & V4L2_CAP_VIDEO_OUTPUT) { 1336 if (itv->card->v4l2_capabilities & V4L2_CAP_VIDEO_OUTPUT) {
1337 /* Turn on the TV-out: ivtv_init_mpeg_decoder() initializes
1338 the mpeg decoder so now the saa7127 receives a proper
1339 signal. */
1340 ivtv_saa7127(itv, VIDIOC_STREAMON, NULL);
1333 ivtv_init_mpeg_decoder(itv); 1341 ivtv_init_mpeg_decoder(itv);
1334 } 1342 }
1335 ivtv_s_std(NULL, &fh, &itv->tuner_std); 1343 ivtv_s_std(NULL, &fh, &itv->tuner_std);
@@ -1366,6 +1374,10 @@ static void ivtv_remove(struct pci_dev *pci_dev)
1366 1374
1367 /* Stop all decoding */ 1375 /* Stop all decoding */
1368 IVTV_DEBUG_INFO("Stopping decoding\n"); 1376 IVTV_DEBUG_INFO("Stopping decoding\n");
1377
1378 /* Turn off the TV-out */
1379 if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)
1380 ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
1369 if (atomic_read(&itv->decoding) > 0) { 1381 if (atomic_read(&itv->decoding) > 0) {
1370 int type; 1382 int type;
1371 1383
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index 24700c211d52..41dbbe9621a1 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -726,6 +726,7 @@ int ivtv_saa7127(struct ivtv *itv, unsigned int cmd, void *arg)
726{ 726{
727 return ivtv_call_i2c_client(itv, IVTV_SAA7127_I2C_ADDR, cmd, arg); 727 return ivtv_call_i2c_client(itv, IVTV_SAA7127_I2C_ADDR, cmd, arg);
728} 728}
729EXPORT_SYMBOL(ivtv_saa7127);
729 730
730int ivtv_saa717x(struct ivtv *itv, unsigned int cmd, void *arg) 731int ivtv_saa717x(struct ivtv *itv, unsigned int cmd, void *arg)
731{ 732{
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 208fb54842f2..4bae38d21ef6 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1756,12 +1756,12 @@ static int ivtv_default(struct file *file, void *fh, int cmd, void *arg)
1756 return 0; 1756 return 0;
1757} 1757}
1758 1758
1759static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct file *filp, 1759static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp,
1760 unsigned int cmd, unsigned long arg) 1760 unsigned int cmd, unsigned long arg)
1761{ 1761{
1762 struct video_device *vfd = video_devdata(filp); 1762 struct video_device *vfd = video_devdata(filp);
1763 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data; 1763 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
1764 int ret; 1764 long ret;
1765 1765
1766 /* Filter dvb ioctls that cannot be handled by the v4l ioctl framework */ 1766 /* Filter dvb ioctls that cannot be handled by the v4l ioctl framework */
1767 switch (cmd) { 1767 switch (cmd) {
@@ -1830,20 +1830,19 @@ static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct f
1830 1830
1831 if (ivtv_debug & IVTV_DBGFLG_IOCTL) 1831 if (ivtv_debug & IVTV_DBGFLG_IOCTL)
1832 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; 1832 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
1833 ret = video_ioctl2(inode, filp, cmd, arg); 1833 ret = __video_ioctl2(filp, cmd, arg);
1834 vfd->debug = 0; 1834 vfd->debug = 0;
1835 return ret; 1835 return ret;
1836} 1836}
1837 1837
1838int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 1838long ivtv_v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1839 unsigned long arg)
1840{ 1839{
1841 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data; 1840 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
1842 struct ivtv *itv = id->itv; 1841 struct ivtv *itv = id->itv;
1843 int res; 1842 long res;
1844 1843
1845 mutex_lock(&itv->serialize_lock); 1844 mutex_lock(&itv->serialize_lock);
1846 res = ivtv_serialized_ioctl(itv, inode, filp, cmd, arg); 1845 res = ivtv_serialized_ioctl(itv, filp, cmd, arg);
1847 mutex_unlock(&itv->serialize_lock); 1846 mutex_unlock(&itv->serialize_lock);
1848 return res; 1847 return res;
1849} 1848}
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.h b/drivers/media/video/ivtv/ivtv-ioctl.h
index 70188588b4f4..58f003412afd 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.h
+++ b/drivers/media/video/ivtv/ivtv-ioctl.h
@@ -30,7 +30,6 @@ void ivtv_set_funcs(struct video_device *vdev);
30int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std); 30int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std);
31int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf); 31int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
32int ivtv_s_input(struct file *file, void *fh, unsigned int inp); 32int ivtv_s_input(struct file *file, void *fh, unsigned int inp);
33int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 33long ivtv_v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
34 unsigned long arg);
35 34
36#endif 35#endif
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index 5bbf31e39304..9b7aa79eb267 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -48,7 +48,7 @@ static const struct file_operations ivtv_v4l2_enc_fops = {
48 .read = ivtv_v4l2_read, 48 .read = ivtv_v4l2_read,
49 .write = ivtv_v4l2_write, 49 .write = ivtv_v4l2_write,
50 .open = ivtv_v4l2_open, 50 .open = ivtv_v4l2_open,
51 .ioctl = ivtv_v4l2_ioctl, 51 .unlocked_ioctl = ivtv_v4l2_ioctl,
52 .compat_ioctl = v4l_compat_ioctl32, 52 .compat_ioctl = v4l_compat_ioctl32,
53 .release = ivtv_v4l2_close, 53 .release = ivtv_v4l2_close,
54 .poll = ivtv_v4l2_enc_poll, 54 .poll = ivtv_v4l2_enc_poll,
@@ -59,7 +59,7 @@ static const struct file_operations ivtv_v4l2_dec_fops = {
59 .read = ivtv_v4l2_read, 59 .read = ivtv_v4l2_read,
60 .write = ivtv_v4l2_write, 60 .write = ivtv_v4l2_write,
61 .open = ivtv_v4l2_open, 61 .open = ivtv_v4l2_open,
62 .ioctl = ivtv_v4l2_ioctl, 62 .unlocked_ioctl = ivtv_v4l2_ioctl,
63 .compat_ioctl = v4l_compat_ioctl32, 63 .compat_ioctl = v4l_compat_ioctl32,
64 .release = ivtv_v4l2_close, 64 .release = ivtv_v4l2_close,
65 .poll = ivtv_v4l2_dec_poll, 65 .poll = ivtv_v4l2_dec_poll,
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c
index 8a4a150b12fb..921e281876f8 100644
--- a/drivers/media/video/ivtv/ivtvfb.c
+++ b/drivers/media/video/ivtv/ivtvfb.c
@@ -48,6 +48,7 @@
48#endif 48#endif
49 49
50#include "ivtv-driver.h" 50#include "ivtv-driver.h"
51#include "ivtv-i2c.h"
51#include "ivtv-udma.h" 52#include "ivtv-udma.h"
52#include "ivtv-mailbox.h" 53#include "ivtv-mailbox.h"
53 54
@@ -894,11 +895,16 @@ static int ivtvfb_blank(int blank_mode, struct fb_info *info)
894 switch (blank_mode) { 895 switch (blank_mode) {
895 case FB_BLANK_UNBLANK: 896 case FB_BLANK_UNBLANK:
896 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 1); 897 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 1);
898 ivtv_saa7127(itv, VIDIOC_STREAMON, NULL);
897 break; 899 break;
898 case FB_BLANK_NORMAL: 900 case FB_BLANK_NORMAL:
899 case FB_BLANK_HSYNC_SUSPEND: 901 case FB_BLANK_HSYNC_SUSPEND:
900 case FB_BLANK_VSYNC_SUSPEND: 902 case FB_BLANK_VSYNC_SUSPEND:
903 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0);
904 ivtv_saa7127(itv, VIDIOC_STREAMON, NULL);
905 break;
901 case FB_BLANK_POWERDOWN: 906 case FB_BLANK_POWERDOWN:
907 ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
902 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0); 908 ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0);
903 break; 909 break;
904 } 910 }
diff --git a/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
index a1252d673b41..273d2a1aa220 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-encoder.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-encoder.c
@@ -402,6 +402,10 @@ static int pvr2_encoder_prep_config(struct pvr2_hdw *hdw)
402 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 0,3,0,0); 402 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 0,3,0,0);
403 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4,15,0,0,0); 403 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4,15,0,0,0);
404 404
405 /* prevent the PTSs from slowly drifting away in the generated
406 MPEG stream */
407 ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC, 2, 4, 1);
408
405 return ret; 409 return ret;
406} 410}
407 411
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 94265bd3d926..5b81ba469641 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -60,7 +60,6 @@ static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL};
60static DEFINE_MUTEX(pvr2_unit_mtx); 60static DEFINE_MUTEX(pvr2_unit_mtx);
61 61
62static int ctlchg; 62static int ctlchg;
63static int initusbreset = 1;
64static int procreload; 63static int procreload;
65static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 }; 64static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 };
66static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 }; 65static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 };
@@ -71,8 +70,6 @@ module_param(ctlchg, int, S_IRUGO|S_IWUSR);
71MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value"); 70MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value");
72module_param(init_pause_msec, int, S_IRUGO|S_IWUSR); 71module_param(init_pause_msec, int, S_IRUGO|S_IWUSR);
73MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay"); 72MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay");
74module_param(initusbreset, int, S_IRUGO|S_IWUSR);
75MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe");
76module_param(procreload, int, S_IRUGO|S_IWUSR); 73module_param(procreload, int, S_IRUGO|S_IWUSR);
77MODULE_PARM_DESC(procreload, 74MODULE_PARM_DESC(procreload,
78 "Attempt init failure recovery with firmware reload"); 75 "Attempt init failure recovery with firmware reload");
@@ -1967,9 +1964,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
1967 } 1964 }
1968 hdw->fw1_state = FW1_STATE_OK; 1965 hdw->fw1_state = FW1_STATE_OK;
1969 1966
1970 if (initusbreset) {
1971 pvr2_hdw_device_reset(hdw);
1972 }
1973 if (!pvr2_hdw_dev_ok(hdw)) return; 1967 if (!pvr2_hdw_dev_ok(hdw)) return;
1974 1968
1975 for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) { 1969 for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index f048d80b77e5..97ed95957992 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -168,7 +168,7 @@ static const char *get_v4l_name(int v4l_type)
168 * This is part of Video 4 Linux API. The procedure handles ioctl() calls. 168 * This is part of Video 4 Linux API. The procedure handles ioctl() calls.
169 * 169 *
170 */ 170 */
171static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, 171static int __pvr2_v4l2_do_ioctl(struct file *file,
172 unsigned int cmd, void *arg) 172 unsigned int cmd, void *arg)
173{ 173{
174 struct pvr2_v4l2_fh *fh = file->private_data; 174 struct pvr2_v4l2_fh *fh = file->private_data;
@@ -863,8 +863,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
863#endif 863#endif
864 864
865 default : 865 default :
866 ret = v4l_compat_translate_ioctl(inode,file,cmd, 866 ret = v4l_compat_translate_ioctl(file, cmd,
867 arg,pvr2_v4l2_do_ioctl); 867 arg, __pvr2_v4l2_do_ioctl);
868 } 868 }
869 869
870 pvr2_hdw_commit_ctl(hdw); 870 pvr2_hdw_commit_ctl(hdw);
@@ -890,10 +890,15 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
890 return ret; 890 return ret;
891} 891}
892 892
893static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
894 unsigned int cmd, void *arg)
895{
896 return __pvr2_v4l2_do_ioctl(file, cmd, arg);
897}
893 898
894static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) 899static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
895{ 900{
896 int minor_id = dip->devbase.minor; 901 int num = dip->devbase.num;
897 struct pvr2_hdw *hdw = dip->v4lp->channel.mc_head->hdw; 902 struct pvr2_hdw *hdw = dip->v4lp->channel.mc_head->hdw;
898 enum pvr2_config cfg = dip->config; 903 enum pvr2_config cfg = dip->config;
899 int v4l_type = dip->v4l_type; 904 int v4l_type = dip->v4l_type;
@@ -909,7 +914,7 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
909 video_unregister_device(&dip->devbase); 914 video_unregister_device(&dip->devbase);
910 915
911 printk(KERN_INFO "pvrusb2: unregistered device %s%u [%s]\n", 916 printk(KERN_INFO "pvrusb2: unregistered device %s%u [%s]\n",
912 get_v4l_name(v4l_type),minor_id & 0x1f, 917 get_v4l_name(v4l_type), num,
913 pvr2_config_get_name(cfg)); 918 pvr2_config_get_name(cfg));
914 919
915} 920}
@@ -1310,7 +1315,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
1310 } 1315 }
1311 1316
1312 printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n", 1317 printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n",
1313 get_v4l_name(dip->v4l_type),dip->devbase.minor & 0x1f, 1318 get_v4l_name(dip->v4l_type), dip->devbase.num,
1314 pvr2_config_get_name(dip->config)); 1319 pvr2_config_get_name(dip->config));
1315 1320
1316 pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw, 1321 pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw,
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index ab28389b4cda..f3897a3fdb75 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -1795,7 +1795,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1795 goto err; 1795 goto err;
1796 } 1796 }
1797 else { 1797 else {
1798 PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F); 1798 PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->num);
1799 } 1799 }
1800 1800
1801 /* occupy slot */ 1801 /* occupy slot */
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index b686bfabbde0..249184452949 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -996,7 +996,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
996 goto fail4; 996 goto fail4;
997 } 997 }
998 printk(KERN_INFO "%s: registered device video%d [v4l2]\n", 998 printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
999 dev->name,dev->video_dev->minor & 0x1f); 999 dev->name, dev->video_dev->num);
1000 1000
1001 dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi"); 1001 dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
1002 1002
@@ -1005,7 +1005,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1005 if (err < 0) 1005 if (err < 0)
1006 goto fail4; 1006 goto fail4;
1007 printk(KERN_INFO "%s: registered device vbi%d\n", 1007 printk(KERN_INFO "%s: registered device vbi%d\n",
1008 dev->name,dev->vbi_dev->minor & 0x1f); 1008 dev->name, dev->vbi_dev->num);
1009 1009
1010 if (card_has_radio(dev)) { 1010 if (card_has_radio(dev)) {
1011 dev->radio_dev = vdev_init(dev,&saa7134_radio_template,"radio"); 1011 dev->radio_dev = vdev_init(dev,&saa7134_radio_template,"radio");
@@ -1014,7 +1014,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1014 if (err < 0) 1014 if (err < 0)
1015 goto fail4; 1015 goto fail4;
1016 printk(KERN_INFO "%s: registered device radio%d\n", 1016 printk(KERN_INFO "%s: registered device radio%d\n",
1017 dev->name,dev->radio_dev->minor & 0x1f); 1017 dev->name, dev->radio_dev->num);
1018 } 1018 }
1019 1019
1020 /* everything worked */ 1020 /* everything worked */
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 9a8766a78a0c..7f40511bcc04 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -534,7 +534,7 @@ static int empress_init(struct saa7134_dev *dev)
534 return err; 534 return err;
535 } 535 }
536 printk(KERN_INFO "%s: registered device video%d [mpeg]\n", 536 printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
537 dev->name,dev->empress_dev->minor & 0x1f); 537 dev->name, dev->empress_dev->num);
538 538
539 videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops, 539 videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops,
540 &dev->pci->dev, &dev->slock, 540 &dev->pci->dev, &dev->slock,
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index ae3949180c4e..044a2e94c34d 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -1412,7 +1412,7 @@ static int se401_probe(struct usb_interface *intf,
1412 return -EIO; 1412 return -EIO;
1413 } 1413 }
1414 dev_info(&intf->dev, "registered new video device: video%d\n", 1414 dev_info(&intf->dev, "registered new video device: video%d\n",
1415 se401->vdev.minor); 1415 se401->vdev.num);
1416 1416
1417 usb_set_intfdata (intf, se401); 1417 usb_set_intfdata (intf, se401);
1418 return 0; 1418 return 0;
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index 20e30bd9364b..fcd2b62f92c4 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -1008,7 +1008,7 @@ static int sn9c102_stream_interrupt(struct sn9c102_device* cam)
1008 cam->state |= DEV_MISCONFIGURED; 1008 cam->state |= DEV_MISCONFIGURED;
1009 DBG(1, "URB timeout reached. The camera is misconfigured. " 1009 DBG(1, "URB timeout reached. The camera is misconfigured. "
1010 "To use it, close and open /dev/video%d again.", 1010 "To use it, close and open /dev/video%d again.",
1011 cam->v4ldev->minor); 1011 cam->v4ldev->num);
1012 return -EIO; 1012 return -EIO;
1013 } 1013 }
1014 1014
@@ -1734,7 +1734,7 @@ static void sn9c102_release_resources(struct kref *kref)
1734 1734
1735 cam = container_of(kref, struct sn9c102_device, kref); 1735 cam = container_of(kref, struct sn9c102_device, kref);
1736 1736
1737 DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor); 1737 DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
1738 video_set_drvdata(cam->v4ldev, NULL); 1738 video_set_drvdata(cam->v4ldev, NULL);
1739 video_unregister_device(cam->v4ldev); 1739 video_unregister_device(cam->v4ldev);
1740 usb_put_dev(cam->usbdev); 1740 usb_put_dev(cam->usbdev);
@@ -1792,7 +1792,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
1792 1792
1793 if (cam->users) { 1793 if (cam->users) {
1794 DBG(2, "Device /dev/video%d is already in use", 1794 DBG(2, "Device /dev/video%d is already in use",
1795 cam->v4ldev->minor); 1795 cam->v4ldev->num);
1796 DBG(3, "Simultaneous opens are not supported"); 1796 DBG(3, "Simultaneous opens are not supported");
1797 /* 1797 /*
1798 open() must follow the open flags and should block 1798 open() must follow the open flags and should block
@@ -1845,7 +1845,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
1845 cam->frame_count = 0; 1845 cam->frame_count = 0;
1846 sn9c102_empty_framequeues(cam); 1846 sn9c102_empty_framequeues(cam);
1847 1847
1848 DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor); 1848 DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
1849 1849
1850out: 1850out:
1851 mutex_unlock(&cam->open_mutex); 1851 mutex_unlock(&cam->open_mutex);
@@ -1870,7 +1870,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
1870 cam->users--; 1870 cam->users--;
1871 wake_up_interruptible_nr(&cam->wait_open, 1); 1871 wake_up_interruptible_nr(&cam->wait_open, 1);
1872 1872
1873 DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor); 1873 DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
1874 1874
1875 kref_put(&cam->kref, sn9c102_release_resources); 1875 kref_put(&cam->kref, sn9c102_release_resources);
1876 1876
@@ -2432,7 +2432,7 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
2432 cam->state |= DEV_MISCONFIGURED; 2432 cam->state |= DEV_MISCONFIGURED;
2433 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " 2433 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
2434 "use the camera, close and open /dev/video%d again.", 2434 "use the camera, close and open /dev/video%d again.",
2435 cam->v4ldev->minor); 2435 cam->v4ldev->num);
2436 return -EIO; 2436 return -EIO;
2437 } 2437 }
2438 2438
@@ -2445,7 +2445,7 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
2445 cam->state |= DEV_MISCONFIGURED; 2445 cam->state |= DEV_MISCONFIGURED;
2446 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " 2446 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
2447 "use the camera, close and open /dev/video%d again.", 2447 "use the camera, close and open /dev/video%d again.",
2448 cam->v4ldev->minor); 2448 cam->v4ldev->num);
2449 return -ENOMEM; 2449 return -ENOMEM;
2450 } 2450 }
2451 2451
@@ -2689,7 +2689,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
2689 cam->state |= DEV_MISCONFIGURED; 2689 cam->state |= DEV_MISCONFIGURED;
2690 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " 2690 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
2691 "use the camera, close and open /dev/video%d again.", 2691 "use the camera, close and open /dev/video%d again.",
2692 cam->v4ldev->minor); 2692 cam->v4ldev->num);
2693 return -EIO; 2693 return -EIO;
2694 } 2694 }
2695 2695
@@ -2701,7 +2701,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
2701 cam->state |= DEV_MISCONFIGURED; 2701 cam->state |= DEV_MISCONFIGURED;
2702 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " 2702 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
2703 "use the camera, close and open /dev/video%d again.", 2703 "use the camera, close and open /dev/video%d again.",
2704 cam->v4ldev->minor); 2704 cam->v4ldev->num);
2705 return -ENOMEM; 2705 return -ENOMEM;
2706 } 2706 }
2707 2707
@@ -2748,7 +2748,7 @@ sn9c102_vidioc_s_jpegcomp(struct sn9c102_device* cam, void __user * arg)
2748 cam->state |= DEV_MISCONFIGURED; 2748 cam->state |= DEV_MISCONFIGURED;
2749 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " 2749 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
2750 "problems. To use the camera, close and open " 2750 "problems. To use the camera, close and open "
2751 "/dev/video%d again.", cam->v4ldev->minor); 2751 "/dev/video%d again.", cam->v4ldev->num);
2752 return -EIO; 2752 return -EIO;
2753 } 2753 }
2754 2754
@@ -3348,7 +3348,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
3348 goto fail; 3348 goto fail;
3349 } 3349 }
3350 3350
3351 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor); 3351 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
3352 3352
3353 video_set_drvdata(cam->v4ldev, cam); 3353 video_set_drvdata(cam->v4ldev, cam);
3354 cam->module_param.force_munmap = force_munmap[dev_nr]; 3354 cam->module_param.force_munmap = force_munmap[dev_nr];
@@ -3402,7 +3402,7 @@ static void sn9c102_usb_disconnect(struct usb_interface* intf)
3402 if (cam->users) { 3402 if (cam->users) {
3403 DBG(2, "Device /dev/video%d is open! Deregistration and " 3403 DBG(2, "Device /dev/video%d is open! Deregistration and "
3404 "memory deallocation are deferred.", 3404 "memory deallocation are deferred.",
3405 cam->v4ldev->minor); 3405 cam->v4ldev->num);
3406 cam->state |= DEV_MISCONFIGURED; 3406 cam->state |= DEV_MISCONFIGURED;
3407 sn9c102_stop_transfer(cam); 3407 sn9c102_stop_transfer(cam);
3408 cam->state |= DEV_DISCONNECTED; 3408 cam->state |= DEV_DISCONNECTED;
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index edaea4964513..e9eb6d754d5c 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -1331,7 +1331,7 @@ static int stk_register_video_device(struct stk_camera *dev)
1331 STK_ERROR("v4l registration failed\n"); 1331 STK_ERROR("v4l registration failed\n");
1332 else 1332 else
1333 STK_INFO("Syntek USB2.0 Camera is now controlling video device" 1333 STK_INFO("Syntek USB2.0 Camera is now controlling video device"
1334 " /dev/video%d\n", dev->vdev.minor); 1334 " /dev/video%d\n", dev->vdev.num);
1335 return err; 1335 return err;
1336} 1336}
1337 1337
@@ -1426,7 +1426,7 @@ static void stk_camera_disconnect(struct usb_interface *interface)
1426 stk_remove_sysfs_files(&dev->vdev); 1426 stk_remove_sysfs_files(&dev->vdev);
1427 1427
1428 STK_INFO("Syntek USB2.0 Camera release resources " 1428 STK_INFO("Syntek USB2.0 Camera release resources "
1429 "video device /dev/video%d\n", dev->vdev.minor); 1429 "video device /dev/video%d\n", dev->vdev.num);
1430 1430
1431 video_unregister_device(&dev->vdev); 1431 video_unregister_device(&dev->vdev);
1432} 1432}
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 9c549d935994..328c41b1517d 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -1470,7 +1470,8 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
1470 retval = -EIO; 1470 retval = -EIO;
1471 goto error_vdev; 1471 goto error_vdev;
1472 } 1472 }
1473 PDEBUG (0, "STV(i): registered new video device: video%d", stv680->vdev->minor); 1473 PDEBUG(0, "STV(i): registered new video device: video%d",
1474 stv680->vdev->num);
1474 1475
1475 usb_set_intfdata (intf, stv680); 1476 usb_set_intfdata (intf, stv680);
1476 retval = stv680_create_sysfs_files(stv680->vdev); 1477 retval = stv680_create_sysfs_files(stv680->vdev);
diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c
index 07cd87d16f69..7c575bb8184f 100644
--- a/drivers/media/video/usbvideo/usbvideo.c
+++ b/drivers/media/video/usbvideo/usbvideo.c
@@ -1059,7 +1059,7 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
1059 1059
1060 dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n", 1060 dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n",
1061 (uvd->handle != NULL) ? uvd->handle->drvName : "???", 1061 (uvd->handle != NULL) ? uvd->handle->drvName : "???",
1062 uvd->vdev.minor, tmp2, tmp1); 1062 uvd->vdev.num, tmp2, tmp1);
1063 1063
1064 usb_get_dev(uvd->dev); 1064 usb_get_dev(uvd->dev);
1065 return 0; 1065 return 0;
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index 7a127d6bfdee..8e2d58bec481 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -877,7 +877,8 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
877 return -EIO; 877 return -EIO;
878 } 878 }
879 879
880 printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",cam->vdev.minor); 880 printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",
881 cam->vdev.num);
881 882
882 usb_set_intfdata (intf, cam); 883 usb_set_intfdata (intf, cam);
883 884
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
index 92427fdc1459..9907b9aff2b9 100644
--- a/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/drivers/media/video/usbvision/usbvision-i2c.c
@@ -236,7 +236,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
236 sizeof(struct i2c_client)); 236 sizeof(struct i2c_client));
237 237
238 sprintf(usbvision->i2c_adap.name + strlen(usbvision->i2c_adap.name), 238 sprintf(usbvision->i2c_adap.name + strlen(usbvision->i2c_adap.name),
239 " #%d", usbvision->vdev->minor & 0x1f); 239 " #%d", usbvision->vdev->num);
240 PDEBUG(DBG_I2C,"Adaptername: %s", usbvision->i2c_adap.name); 240 PDEBUG(DBG_I2C,"Adaptername: %s", usbvision->i2c_adap.name);
241 usbvision->i2c_adap.dev.parent = &usbvision->dev->dev; 241 usbvision->i2c_adap.dev.parent = &usbvision->dev->dev;
242 242
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 77aeb39b2750..d185b57fdcd0 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -1440,7 +1440,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
1440 // vbi Device: 1440 // vbi Device:
1441 if (usbvision->vbi) { 1441 if (usbvision->vbi) {
1442 PDEBUG(DBG_PROBE, "unregister /dev/vbi%d [v4l2]", 1442 PDEBUG(DBG_PROBE, "unregister /dev/vbi%d [v4l2]",
1443 usbvision->vbi->minor & 0x1f); 1443 usbvision->vbi->num);
1444 if (usbvision->vbi->minor != -1) { 1444 if (usbvision->vbi->minor != -1) {
1445 video_unregister_device(usbvision->vbi); 1445 video_unregister_device(usbvision->vbi);
1446 } else { 1446 } else {
@@ -1452,7 +1452,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
1452 // Radio Device: 1452 // Radio Device:
1453 if (usbvision->rdev) { 1453 if (usbvision->rdev) {
1454 PDEBUG(DBG_PROBE, "unregister /dev/radio%d [v4l2]", 1454 PDEBUG(DBG_PROBE, "unregister /dev/radio%d [v4l2]",
1455 usbvision->rdev->minor & 0x1f); 1455 usbvision->rdev->num);
1456 if (usbvision->rdev->minor != -1) { 1456 if (usbvision->rdev->minor != -1) {
1457 video_unregister_device(usbvision->rdev); 1457 video_unregister_device(usbvision->rdev);
1458 } else { 1458 } else {
@@ -1464,7 +1464,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
1464 // Video Device: 1464 // Video Device:
1465 if (usbvision->vdev) { 1465 if (usbvision->vdev) {
1466 PDEBUG(DBG_PROBE, "unregister /dev/video%d [v4l2]", 1466 PDEBUG(DBG_PROBE, "unregister /dev/video%d [v4l2]",
1467 usbvision->vdev->minor & 0x1f); 1467 usbvision->vdev->num);
1468 if (usbvision->vdev->minor != -1) { 1468 if (usbvision->vdev->minor != -1) {
1469 video_unregister_device(usbvision->vdev); 1469 video_unregister_device(usbvision->vdev);
1470 } else { 1470 } else {
@@ -1490,7 +1490,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
1490 goto err_exit; 1490 goto err_exit;
1491 } 1491 }
1492 printk(KERN_INFO "USBVision[%d]: registered USBVision Video device /dev/video%d [v4l2]\n", 1492 printk(KERN_INFO "USBVision[%d]: registered USBVision Video device /dev/video%d [v4l2]\n",
1493 usbvision->nr,usbvision->vdev->minor & 0x1f); 1493 usbvision->nr, usbvision->vdev->num);
1494 1494
1495 // Radio Device: 1495 // Radio Device:
1496 if (usbvision_device_data[usbvision->DevModel].Radio) { 1496 if (usbvision_device_data[usbvision->DevModel].Radio) {
@@ -1507,7 +1507,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
1507 goto err_exit; 1507 goto err_exit;
1508 } 1508 }
1509 printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device /dev/radio%d [v4l2]\n", 1509 printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device /dev/radio%d [v4l2]\n",
1510 usbvision->nr, usbvision->rdev->minor & 0x1f); 1510 usbvision->nr, usbvision->rdev->num);
1511 } 1511 }
1512 // vbi Device: 1512 // vbi Device:
1513 if (usbvision_device_data[usbvision->DevModel].vbi) { 1513 if (usbvision_device_data[usbvision->DevModel].vbi) {
@@ -1523,7 +1523,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
1523 goto err_exit; 1523 goto err_exit;
1524 } 1524 }
1525 printk(KERN_INFO "USBVision[%d]: registered USBVision VBI device /dev/vbi%d [v4l2] (Not Working Yet!)\n", 1525 printk(KERN_INFO "USBVision[%d]: registered USBVision VBI device /dev/vbi%d [v4l2] (Not Working Yet!)\n",
1526 usbvision->nr,usbvision->vbi->minor & 0x1f); 1526 usbvision->nr, usbvision->vbi->num);
1527 } 1527 }
1528 // all done 1528 // all done
1529 return 0; 1529 return 0;
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index 78e4c4e09d89..758dfefaba8d 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -464,7 +464,7 @@ static int uvc_v4l2_release(struct inode *inode, struct file *file)
464 return 0; 464 return 0;
465} 465}
466 466
467static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file, 467static int __uvc_v4l2_do_ioctl(struct file *file,
468 unsigned int cmd, void *arg) 468 unsigned int cmd, void *arg)
469{ 469{
470 struct video_device *vdev = video_devdata(file); 470 struct video_device *vdev = video_devdata(file);
@@ -978,8 +978,8 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
978 return uvc_xu_ctrl_query(video, arg, 1); 978 return uvc_xu_ctrl_query(video, arg, 1);
979 979
980 default: 980 default:
981 if ((ret = v4l_compat_translate_ioctl(inode, file, cmd, arg, 981 if ((ret = v4l_compat_translate_ioctl(file, cmd, arg,
982 uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD) 982 __uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD)
983 uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n", 983 uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n",
984 cmd); 984 cmd);
985 return ret; 985 return ret;
@@ -988,6 +988,12 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
988 return ret; 988 return ret;
989} 989}
990 990
991static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
992 unsigned int cmd, void *arg)
993{
994 return __uvc_v4l2_do_ioctl(file, cmd, arg);
995}
996
991static int uvc_v4l2_ioctl(struct inode *inode, struct file *file, 997static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
992 unsigned int cmd, unsigned long arg) 998 unsigned int cmd, unsigned long arg)
993{ 999{
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index 928cb4037372..f13c0a9d684f 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -57,8 +57,7 @@ MODULE_LICENSE("GPL");
57 */ 57 */
58 58
59static int 59static int
60get_v4l_control(struct inode *inode, 60get_v4l_control(struct file *file,
61 struct file *file,
62 int cid, 61 int cid,
63 v4l2_kioctl drv) 62 v4l2_kioctl drv)
64{ 63{
@@ -67,12 +66,12 @@ get_v4l_control(struct inode *inode,
67 int err; 66 int err;
68 67
69 qctrl2.id = cid; 68 qctrl2.id = cid;
70 err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2); 69 err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
71 if (err < 0) 70 if (err < 0)
72 dprintk("VIDIOC_QUERYCTRL: %d\n", err); 71 dprintk("VIDIOC_QUERYCTRL: %d\n", err);
73 if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) { 72 if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) {
74 ctrl2.id = qctrl2.id; 73 ctrl2.id = qctrl2.id;
75 err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2); 74 err = drv(file, VIDIOC_G_CTRL, &ctrl2);
76 if (err < 0) { 75 if (err < 0) {
77 dprintk("VIDIOC_G_CTRL: %d\n", err); 76 dprintk("VIDIOC_G_CTRL: %d\n", err);
78 return 0; 77 return 0;
@@ -85,8 +84,7 @@ get_v4l_control(struct inode *inode,
85} 84}
86 85
87static int 86static int
88set_v4l_control(struct inode *inode, 87set_v4l_control(struct file *file,
89 struct file *file,
90 int cid, 88 int cid,
91 int value, 89 int value,
92 v4l2_kioctl drv) 90 v4l2_kioctl drv)
@@ -96,7 +94,7 @@ set_v4l_control(struct inode *inode,
96 int err; 94 int err;
97 95
98 qctrl2.id = cid; 96 qctrl2.id = cid;
99 err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2); 97 err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
100 if (err < 0) 98 if (err < 0)
101 dprintk("VIDIOC_QUERYCTRL: %d\n", err); 99 dprintk("VIDIOC_QUERYCTRL: %d\n", err);
102 if (err == 0 && 100 if (err == 0 &&
@@ -114,7 +112,7 @@ set_v4l_control(struct inode *inode,
114 + 32767) 112 + 32767)
115 / 65535; 113 / 65535;
116 ctrl2.value += qctrl2.minimum; 114 ctrl2.value += qctrl2.minimum;
117 err = drv(inode, file, VIDIOC_S_CTRL, &ctrl2); 115 err = drv(file, VIDIOC_S_CTRL, &ctrl2);
118 if (err < 0) 116 if (err < 0)
119 dprintk("VIDIOC_S_CTRL: %d\n", err); 117 dprintk("VIDIOC_S_CTRL: %d\n", err);
120 } 118 }
@@ -222,7 +220,6 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
222} 220}
223 221
224static int count_inputs( 222static int count_inputs(
225 struct inode *inode,
226 struct file *file, 223 struct file *file,
227 v4l2_kioctl drv) 224 v4l2_kioctl drv)
228{ 225{
@@ -232,14 +229,13 @@ static int count_inputs(
232 for (i = 0;; i++) { 229 for (i = 0;; i++) {
233 memset(&input2, 0, sizeof(input2)); 230 memset(&input2, 0, sizeof(input2));
234 input2.index = i; 231 input2.index = i;
235 if (0 != drv(inode, file, VIDIOC_ENUMINPUT, &input2)) 232 if (0 != drv(file, VIDIOC_ENUMINPUT, &input2))
236 break; 233 break;
237 } 234 }
238 return i; 235 return i;
239} 236}
240 237
241static int check_size( 238static int check_size(
242 struct inode *inode,
243 struct file *file, 239 struct file *file,
244 v4l2_kioctl drv, 240 v4l2_kioctl drv,
245 int *maxw, 241 int *maxw,
@@ -252,14 +248,14 @@ static int check_size(
252 memset(&fmt2, 0, sizeof(fmt2)); 248 memset(&fmt2, 0, sizeof(fmt2));
253 249
254 desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 250 desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
255 if (0 != drv(inode, file, VIDIOC_ENUM_FMT, &desc2)) 251 if (0 != drv(file, VIDIOC_ENUM_FMT, &desc2))
256 goto done; 252 goto done;
257 253
258 fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 254 fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
259 fmt2.fmt.pix.width = 10000; 255 fmt2.fmt.pix.width = 10000;
260 fmt2.fmt.pix.height = 10000; 256 fmt2.fmt.pix.height = 10000;
261 fmt2.fmt.pix.pixelformat = desc2.pixelformat; 257 fmt2.fmt.pix.pixelformat = desc2.pixelformat;
262 if (0 != drv(inode, file, VIDIOC_TRY_FMT, &fmt2)) 258 if (0 != drv(file, VIDIOC_TRY_FMT, &fmt2))
263 goto done; 259 goto done;
264 260
265 *maxw = fmt2.fmt.pix.width; 261 *maxw = fmt2.fmt.pix.width;
@@ -273,7 +269,6 @@ done:
273 269
274static noinline int v4l1_compat_get_capabilities( 270static noinline int v4l1_compat_get_capabilities(
275 struct video_capability *cap, 271 struct video_capability *cap,
276 struct inode *inode,
277 struct file *file, 272 struct file *file,
278 v4l2_kioctl drv) 273 v4l2_kioctl drv)
279{ 274{
@@ -289,13 +284,13 @@ static noinline int v4l1_compat_get_capabilities(
289 memset(cap, 0, sizeof(*cap)); 284 memset(cap, 0, sizeof(*cap));
290 memset(&fbuf, 0, sizeof(fbuf)); 285 memset(&fbuf, 0, sizeof(fbuf));
291 286
292 err = drv(inode, file, VIDIOC_QUERYCAP, cap2); 287 err = drv(file, VIDIOC_QUERYCAP, cap2);
293 if (err < 0) { 288 if (err < 0) {
294 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err); 289 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err);
295 goto done; 290 goto done;
296 } 291 }
297 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) { 292 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
298 err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); 293 err = drv(file, VIDIOC_G_FBUF, &fbuf);
299 if (err < 0) { 294 if (err < 0) {
300 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err); 295 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err);
301 memset(&fbuf, 0, sizeof(fbuf)); 296 memset(&fbuf, 0, sizeof(fbuf));
@@ -317,8 +312,8 @@ static noinline int v4l1_compat_get_capabilities(
317 if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING) 312 if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING)
318 cap->type |= VID_TYPE_CLIPPING; 313 cap->type |= VID_TYPE_CLIPPING;
319 314
320 cap->channels = count_inputs(inode, file, drv); 315 cap->channels = count_inputs(file, drv);
321 check_size(inode, file, drv, 316 check_size(file, drv,
322 &cap->maxwidth, &cap->maxheight); 317 &cap->maxwidth, &cap->maxheight);
323 cap->audios = 0; /* FIXME */ 318 cap->audios = 0; /* FIXME */
324 cap->minwidth = 48; /* FIXME */ 319 cap->minwidth = 48; /* FIXME */
@@ -331,7 +326,6 @@ done:
331 326
332static noinline int v4l1_compat_get_frame_buffer( 327static noinline int v4l1_compat_get_frame_buffer(
333 struct video_buffer *buffer, 328 struct video_buffer *buffer,
334 struct inode *inode,
335 struct file *file, 329 struct file *file,
336 v4l2_kioctl drv) 330 v4l2_kioctl drv)
337{ 331{
@@ -341,7 +335,7 @@ static noinline int v4l1_compat_get_frame_buffer(
341 memset(buffer, 0, sizeof(*buffer)); 335 memset(buffer, 0, sizeof(*buffer));
342 memset(&fbuf, 0, sizeof(fbuf)); 336 memset(&fbuf, 0, sizeof(fbuf));
343 337
344 err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); 338 err = drv(file, VIDIOC_G_FBUF, &fbuf);
345 if (err < 0) { 339 if (err < 0) {
346 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err); 340 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err);
347 goto done; 341 goto done;
@@ -386,7 +380,6 @@ done:
386 380
387static noinline int v4l1_compat_set_frame_buffer( 381static noinline int v4l1_compat_set_frame_buffer(
388 struct video_buffer *buffer, 382 struct video_buffer *buffer,
389 struct inode *inode,
390 struct file *file, 383 struct file *file,
391 v4l2_kioctl drv) 384 v4l2_kioctl drv)
392{ 385{
@@ -415,7 +408,7 @@ static noinline int v4l1_compat_set_frame_buffer(
415 break; 408 break;
416 } 409 }
417 fbuf.fmt.bytesperline = buffer->bytesperline; 410 fbuf.fmt.bytesperline = buffer->bytesperline;
418 err = drv(inode, file, VIDIOC_S_FBUF, &fbuf); 411 err = drv(file, VIDIOC_S_FBUF, &fbuf);
419 if (err < 0) 412 if (err < 0)
420 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err); 413 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err);
421 return err; 414 return err;
@@ -423,7 +416,6 @@ static noinline int v4l1_compat_set_frame_buffer(
423 416
424static noinline int v4l1_compat_get_win_cap_dimensions( 417static noinline int v4l1_compat_get_win_cap_dimensions(
425 struct video_window *win, 418 struct video_window *win,
426 struct inode *inode,
427 struct file *file, 419 struct file *file,
428 v4l2_kioctl drv) 420 v4l2_kioctl drv)
429{ 421{
@@ -438,7 +430,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
438 memset(win, 0, sizeof(*win)); 430 memset(win, 0, sizeof(*win));
439 431
440 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; 432 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
441 err = drv(inode, file, VIDIOC_G_FMT, fmt); 433 err = drv(file, VIDIOC_G_FMT, fmt);
442 if (err < 0) 434 if (err < 0)
443 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err); 435 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err);
444 if (err == 0) { 436 if (err == 0) {
@@ -453,7 +445,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
453 } 445 }
454 446
455 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 447 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
456 err = drv(inode, file, VIDIOC_G_FMT, fmt); 448 err = drv(file, VIDIOC_G_FMT, fmt);
457 if (err < 0) { 449 if (err < 0) {
458 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err); 450 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err);
459 goto done; 451 goto done;
@@ -472,7 +464,6 @@ done:
472 464
473static noinline int v4l1_compat_set_win_cap_dimensions( 465static noinline int v4l1_compat_set_win_cap_dimensions(
474 struct video_window *win, 466 struct video_window *win,
475 struct inode *inode,
476 struct file *file, 467 struct file *file,
477 v4l2_kioctl drv) 468 v4l2_kioctl drv)
478{ 469{
@@ -485,8 +476,8 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
485 return err; 476 return err;
486 } 477 }
487 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 478 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
488 drv(inode, file, VIDIOC_STREAMOFF, &fmt->type); 479 drv(file, VIDIOC_STREAMOFF, &fmt->type);
489 err1 = drv(inode, file, VIDIOC_G_FMT, fmt); 480 err1 = drv(file, VIDIOC_G_FMT, fmt);
490 if (err1 < 0) 481 if (err1 < 0)
491 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1); 482 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1);
492 if (err1 == 0) { 483 if (err1 == 0) {
@@ -494,7 +485,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
494 fmt->fmt.pix.height = win->height; 485 fmt->fmt.pix.height = win->height;
495 fmt->fmt.pix.field = V4L2_FIELD_ANY; 486 fmt->fmt.pix.field = V4L2_FIELD_ANY;
496 fmt->fmt.pix.bytesperline = 0; 487 fmt->fmt.pix.bytesperline = 0;
497 err = drv(inode, file, VIDIOC_S_FMT, fmt); 488 err = drv(file, VIDIOC_S_FMT, fmt);
498 if (err < 0) 489 if (err < 0)
499 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n", 490 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
500 err); 491 err);
@@ -511,7 +502,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
511 fmt->fmt.win.chromakey = win->chromakey; 502 fmt->fmt.win.chromakey = win->chromakey;
512 fmt->fmt.win.clips = (void __user *)win->clips; 503 fmt->fmt.win.clips = (void __user *)win->clips;
513 fmt->fmt.win.clipcount = win->clipcount; 504 fmt->fmt.win.clipcount = win->clipcount;
514 err2 = drv(inode, file, VIDIOC_S_FMT, fmt); 505 err2 = drv(file, VIDIOC_S_FMT, fmt);
515 if (err2 < 0) 506 if (err2 < 0)
516 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2); 507 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2);
517 508
@@ -525,7 +516,6 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
525 516
526static noinline int v4l1_compat_turn_preview_on_off( 517static noinline int v4l1_compat_turn_preview_on_off(
527 int *on, 518 int *on,
528 struct inode *inode,
529 struct file *file, 519 struct file *file,
530 v4l2_kioctl drv) 520 v4l2_kioctl drv)
531{ 521{
@@ -536,9 +526,9 @@ static noinline int v4l1_compat_turn_preview_on_off(
536 /* dirty hack time. But v4l1 has no STREAMOFF 526 /* dirty hack time. But v4l1 has no STREAMOFF
537 * equivalent in the API, and this one at 527 * equivalent in the API, and this one at
538 * least comes close ... */ 528 * least comes close ... */
539 drv(inode, file, VIDIOC_STREAMOFF, &captype); 529 drv(file, VIDIOC_STREAMOFF, &captype);
540 } 530 }
541 err = drv(inode, file, VIDIOC_OVERLAY, on); 531 err = drv(file, VIDIOC_OVERLAY, on);
542 if (err < 0) 532 if (err < 0)
543 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err); 533 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err);
544 return err; 534 return err;
@@ -546,7 +536,6 @@ static noinline int v4l1_compat_turn_preview_on_off(
546 536
547static noinline int v4l1_compat_get_input_info( 537static noinline int v4l1_compat_get_input_info(
548 struct video_channel *chan, 538 struct video_channel *chan,
549 struct inode *inode,
550 struct file *file, 539 struct file *file,
551 v4l2_kioctl drv) 540 v4l2_kioctl drv)
552{ 541{
@@ -556,7 +545,7 @@ static noinline int v4l1_compat_get_input_info(
556 545
557 memset(&input2, 0, sizeof(input2)); 546 memset(&input2, 0, sizeof(input2));
558 input2.index = chan->channel; 547 input2.index = chan->channel;
559 err = drv(inode, file, VIDIOC_ENUMINPUT, &input2); 548 err = drv(file, VIDIOC_ENUMINPUT, &input2);
560 if (err < 0) { 549 if (err < 0) {
561 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: " 550 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
562 "channel=%d err=%d\n", chan->channel, err); 551 "channel=%d err=%d\n", chan->channel, err);
@@ -578,7 +567,7 @@ static noinline int v4l1_compat_get_input_info(
578 break; 567 break;
579 } 568 }
580 chan->norm = 0; 569 chan->norm = 0;
581 err = drv(inode, file, VIDIOC_G_STD, &sid); 570 err = drv(file, VIDIOC_G_STD, &sid);
582 if (err < 0) 571 if (err < 0)
583 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err); 572 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err);
584 if (err == 0) { 573 if (err == 0) {
@@ -595,14 +584,13 @@ done:
595 584
596static noinline int v4l1_compat_set_input( 585static noinline int v4l1_compat_set_input(
597 struct video_channel *chan, 586 struct video_channel *chan,
598 struct inode *inode,
599 struct file *file, 587 struct file *file,
600 v4l2_kioctl drv) 588 v4l2_kioctl drv)
601{ 589{
602 int err; 590 int err;
603 v4l2_std_id sid = 0; 591 v4l2_std_id sid = 0;
604 592
605 err = drv(inode, file, VIDIOC_S_INPUT, &chan->channel); 593 err = drv(file, VIDIOC_S_INPUT, &chan->channel);
606 if (err < 0) 594 if (err < 0)
607 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err); 595 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err);
608 switch (chan->norm) { 596 switch (chan->norm) {
@@ -617,7 +605,7 @@ static noinline int v4l1_compat_set_input(
617 break; 605 break;
618 } 606 }
619 if (0 != sid) { 607 if (0 != sid) {
620 err = drv(inode, file, VIDIOC_S_STD, &sid); 608 err = drv(file, VIDIOC_S_STD, &sid);
621 if (err < 0) 609 if (err < 0)
622 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err); 610 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err);
623 } 611 }
@@ -626,7 +614,6 @@ static noinline int v4l1_compat_set_input(
626 614
627static noinline int v4l1_compat_get_picture( 615static noinline int v4l1_compat_get_picture(
628 struct video_picture *pict, 616 struct video_picture *pict,
629 struct inode *inode,
630 struct file *file, 617 struct file *file,
631 v4l2_kioctl drv) 618 v4l2_kioctl drv)
632{ 619{
@@ -639,19 +626,19 @@ static noinline int v4l1_compat_get_picture(
639 return err; 626 return err;
640 } 627 }
641 628
642 pict->brightness = get_v4l_control(inode, file, 629 pict->brightness = get_v4l_control(file,
643 V4L2_CID_BRIGHTNESS, drv); 630 V4L2_CID_BRIGHTNESS, drv);
644 pict->hue = get_v4l_control(inode, file, 631 pict->hue = get_v4l_control(file,
645 V4L2_CID_HUE, drv); 632 V4L2_CID_HUE, drv);
646 pict->contrast = get_v4l_control(inode, file, 633 pict->contrast = get_v4l_control(file,
647 V4L2_CID_CONTRAST, drv); 634 V4L2_CID_CONTRAST, drv);
648 pict->colour = get_v4l_control(inode, file, 635 pict->colour = get_v4l_control(file,
649 V4L2_CID_SATURATION, drv); 636 V4L2_CID_SATURATION, drv);
650 pict->whiteness = get_v4l_control(inode, file, 637 pict->whiteness = get_v4l_control(file,
651 V4L2_CID_WHITENESS, drv); 638 V4L2_CID_WHITENESS, drv);
652 639
653 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 640 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
654 err = drv(inode, file, VIDIOC_G_FMT, fmt); 641 err = drv(file, VIDIOC_G_FMT, fmt);
655 if (err < 0) { 642 if (err < 0) {
656 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err); 643 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err);
657 goto done; 644 goto done;
@@ -669,7 +656,6 @@ done:
669 656
670static noinline int v4l1_compat_set_picture( 657static noinline int v4l1_compat_set_picture(
671 struct video_picture *pict, 658 struct video_picture *pict,
672 struct inode *inode,
673 struct file *file, 659 struct file *file,
674 v4l2_kioctl drv) 660 v4l2_kioctl drv)
675{ 661{
@@ -685,15 +671,15 @@ static noinline int v4l1_compat_set_picture(
685 } 671 }
686 memset(&fbuf, 0, sizeof(fbuf)); 672 memset(&fbuf, 0, sizeof(fbuf));
687 673
688 set_v4l_control(inode, file, 674 set_v4l_control(file,
689 V4L2_CID_BRIGHTNESS, pict->brightness, drv); 675 V4L2_CID_BRIGHTNESS, pict->brightness, drv);
690 set_v4l_control(inode, file, 676 set_v4l_control(file,
691 V4L2_CID_HUE, pict->hue, drv); 677 V4L2_CID_HUE, pict->hue, drv);
692 set_v4l_control(inode, file, 678 set_v4l_control(file,
693 V4L2_CID_CONTRAST, pict->contrast, drv); 679 V4L2_CID_CONTRAST, pict->contrast, drv);
694 set_v4l_control(inode, file, 680 set_v4l_control(file,
695 V4L2_CID_SATURATION, pict->colour, drv); 681 V4L2_CID_SATURATION, pict->colour, drv);
696 set_v4l_control(inode, file, 682 set_v4l_control(file,
697 V4L2_CID_WHITENESS, pict->whiteness, drv); 683 V4L2_CID_WHITENESS, pict->whiteness, drv);
698 /* 684 /*
699 * V4L1 uses this ioctl to set both memory capture and overlay 685 * V4L1 uses this ioctl to set both memory capture and overlay
@@ -703,7 +689,7 @@ static noinline int v4l1_compat_set_picture(
703 */ 689 */
704 690
705 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 691 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
706 err = drv(inode, file, VIDIOC_G_FMT, fmt); 692 err = drv(file, VIDIOC_G_FMT, fmt);
707 /* If VIDIOC_G_FMT failed, then the driver likely doesn't 693 /* If VIDIOC_G_FMT failed, then the driver likely doesn't
708 support memory capture. Trying to set the memory capture 694 support memory capture. Trying to set the memory capture
709 parameters would be pointless. */ 695 parameters would be pointless. */
@@ -714,13 +700,13 @@ static noinline int v4l1_compat_set_picture(
714 palette_to_pixelformat(pict->palette)) { 700 palette_to_pixelformat(pict->palette)) {
715 fmt->fmt.pix.pixelformat = palette_to_pixelformat( 701 fmt->fmt.pix.pixelformat = palette_to_pixelformat(
716 pict->palette); 702 pict->palette);
717 mem_err = drv(inode, file, VIDIOC_S_FMT, fmt); 703 mem_err = drv(file, VIDIOC_S_FMT, fmt);
718 if (mem_err < 0) 704 if (mem_err < 0)
719 dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n", 705 dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n",
720 mem_err); 706 mem_err);
721 } 707 }
722 708
723 err = drv(inode, file, VIDIOC_G_FBUF, &fbuf); 709 err = drv(file, VIDIOC_G_FBUF, &fbuf);
724 /* If VIDIOC_G_FBUF failed, then the driver likely doesn't 710 /* If VIDIOC_G_FBUF failed, then the driver likely doesn't
725 support overlay. Trying to set the overlay parameters 711 support overlay. Trying to set the overlay parameters
726 would be quite pointless. */ 712 would be quite pointless. */
@@ -731,7 +717,7 @@ static noinline int v4l1_compat_set_picture(
731 palette_to_pixelformat(pict->palette)) { 717 palette_to_pixelformat(pict->palette)) {
732 fbuf.fmt.pixelformat = palette_to_pixelformat( 718 fbuf.fmt.pixelformat = palette_to_pixelformat(
733 pict->palette); 719 pict->palette);
734 ovl_err = drv(inode, file, VIDIOC_S_FBUF, &fbuf); 720 ovl_err = drv(file, VIDIOC_S_FBUF, &fbuf);
735 if (ovl_err < 0) 721 if (ovl_err < 0)
736 dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n", 722 dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n",
737 ovl_err); 723 ovl_err);
@@ -752,7 +738,6 @@ static noinline int v4l1_compat_set_picture(
752 738
753static noinline int v4l1_compat_get_tuner( 739static noinline int v4l1_compat_get_tuner(
754 struct video_tuner *tun, 740 struct video_tuner *tun,
755 struct inode *inode,
756 struct file *file, 741 struct file *file,
757 v4l2_kioctl drv) 742 v4l2_kioctl drv)
758{ 743{
@@ -762,7 +747,7 @@ static noinline int v4l1_compat_get_tuner(
762 v4l2_std_id sid; 747 v4l2_std_id sid;
763 748
764 memset(&tun2, 0, sizeof(tun2)); 749 memset(&tun2, 0, sizeof(tun2));
765 err = drv(inode, file, VIDIOC_G_TUNER, &tun2); 750 err = drv(file, VIDIOC_G_TUNER, &tun2);
766 if (err < 0) { 751 if (err < 0) {
767 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err); 752 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err);
768 goto done; 753 goto done;
@@ -778,7 +763,7 @@ static noinline int v4l1_compat_get_tuner(
778 for (i = 0; i < 64; i++) { 763 for (i = 0; i < 64; i++) {
779 memset(&std2, 0, sizeof(std2)); 764 memset(&std2, 0, sizeof(std2));
780 std2.index = i; 765 std2.index = i;
781 if (0 != drv(inode, file, VIDIOC_ENUMSTD, &std2)) 766 if (0 != drv(file, VIDIOC_ENUMSTD, &std2))
782 break; 767 break;
783 if (std2.id & V4L2_STD_PAL) 768 if (std2.id & V4L2_STD_PAL)
784 tun->flags |= VIDEO_TUNER_PAL; 769 tun->flags |= VIDEO_TUNER_PAL;
@@ -788,7 +773,7 @@ static noinline int v4l1_compat_get_tuner(
788 tun->flags |= VIDEO_TUNER_SECAM; 773 tun->flags |= VIDEO_TUNER_SECAM;
789 } 774 }
790 775
791 err = drv(inode, file, VIDIOC_G_STD, &sid); 776 err = drv(file, VIDIOC_G_STD, &sid);
792 if (err < 0) 777 if (err < 0)
793 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err); 778 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err);
794 if (err == 0) { 779 if (err == 0) {
@@ -811,7 +796,6 @@ done:
811 796
812static noinline int v4l1_compat_select_tuner( 797static noinline int v4l1_compat_select_tuner(
813 struct video_tuner *tun, 798 struct video_tuner *tun,
814 struct inode *inode,
815 struct file *file, 799 struct file *file,
816 v4l2_kioctl drv) 800 v4l2_kioctl drv)
817{ 801{
@@ -821,7 +805,7 @@ static noinline int v4l1_compat_select_tuner(
821 805
822 t.index = tun->tuner; 806 t.index = tun->tuner;
823 807
824 err = drv(inode, file, VIDIOC_S_INPUT, &t); 808 err = drv(file, VIDIOC_S_INPUT, &t);
825 if (err < 0) 809 if (err < 0)
826 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err); 810 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err);
827 return err; 811 return err;
@@ -829,7 +813,6 @@ static noinline int v4l1_compat_select_tuner(
829 813
830static noinline int v4l1_compat_get_frequency( 814static noinline int v4l1_compat_get_frequency(
831 unsigned long *freq, 815 unsigned long *freq,
832 struct inode *inode,
833 struct file *file, 816 struct file *file,
834 v4l2_kioctl drv) 817 v4l2_kioctl drv)
835{ 818{
@@ -838,7 +821,7 @@ static noinline int v4l1_compat_get_frequency(
838 memset(&freq2, 0, sizeof(freq2)); 821 memset(&freq2, 0, sizeof(freq2));
839 822
840 freq2.tuner = 0; 823 freq2.tuner = 0;
841 err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); 824 err = drv(file, VIDIOC_G_FREQUENCY, &freq2);
842 if (err < 0) 825 if (err < 0)
843 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err); 826 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err);
844 if (0 == err) 827 if (0 == err)
@@ -848,7 +831,6 @@ static noinline int v4l1_compat_get_frequency(
848 831
849static noinline int v4l1_compat_set_frequency( 832static noinline int v4l1_compat_set_frequency(
850 unsigned long *freq, 833 unsigned long *freq,
851 struct inode *inode,
852 struct file *file, 834 struct file *file,
853 v4l2_kioctl drv) 835 v4l2_kioctl drv)
854{ 836{
@@ -856,9 +838,9 @@ static noinline int v4l1_compat_set_frequency(
856 struct v4l2_frequency freq2; 838 struct v4l2_frequency freq2;
857 memset(&freq2, 0, sizeof(freq2)); 839 memset(&freq2, 0, sizeof(freq2));
858 840
859 drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); 841 drv(file, VIDIOC_G_FREQUENCY, &freq2);
860 freq2.frequency = *freq; 842 freq2.frequency = *freq;
861 err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2); 843 err = drv(file, VIDIOC_S_FREQUENCY, &freq2);
862 if (err < 0) 844 if (err < 0)
863 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err); 845 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err);
864 return err; 846 return err;
@@ -866,7 +848,6 @@ static noinline int v4l1_compat_set_frequency(
866 848
867static noinline int v4l1_compat_get_audio( 849static noinline int v4l1_compat_get_audio(
868 struct video_audio *aud, 850 struct video_audio *aud,
869 struct inode *inode,
870 struct file *file, 851 struct file *file,
871 v4l2_kioctl drv) 852 v4l2_kioctl drv)
872{ 853{
@@ -876,7 +857,7 @@ static noinline int v4l1_compat_get_audio(
876 struct v4l2_tuner tun2; 857 struct v4l2_tuner tun2;
877 memset(&aud2, 0, sizeof(aud2)); 858 memset(&aud2, 0, sizeof(aud2));
878 859
879 err = drv(inode, file, VIDIOC_G_AUDIO, &aud2); 860 err = drv(file, VIDIOC_G_AUDIO, &aud2);
880 if (err < 0) { 861 if (err < 0) {
881 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err); 862 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err);
882 goto done; 863 goto done;
@@ -886,27 +867,27 @@ static noinline int v4l1_compat_get_audio(
886 aud->name[sizeof(aud->name) - 1] = 0; 867 aud->name[sizeof(aud->name) - 1] = 0;
887 aud->audio = aud2.index; 868 aud->audio = aud2.index;
888 aud->flags = 0; 869 aud->flags = 0;
889 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, drv); 870 i = get_v4l_control(file, V4L2_CID_AUDIO_VOLUME, drv);
890 if (i >= 0) { 871 if (i >= 0) {
891 aud->volume = i; 872 aud->volume = i;
892 aud->flags |= VIDEO_AUDIO_VOLUME; 873 aud->flags |= VIDEO_AUDIO_VOLUME;
893 } 874 }
894 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, drv); 875 i = get_v4l_control(file, V4L2_CID_AUDIO_BASS, drv);
895 if (i >= 0) { 876 if (i >= 0) {
896 aud->bass = i; 877 aud->bass = i;
897 aud->flags |= VIDEO_AUDIO_BASS; 878 aud->flags |= VIDEO_AUDIO_BASS;
898 } 879 }
899 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, drv); 880 i = get_v4l_control(file, V4L2_CID_AUDIO_TREBLE, drv);
900 if (i >= 0) { 881 if (i >= 0) {
901 aud->treble = i; 882 aud->treble = i;
902 aud->flags |= VIDEO_AUDIO_TREBLE; 883 aud->flags |= VIDEO_AUDIO_TREBLE;
903 } 884 }
904 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, drv); 885 i = get_v4l_control(file, V4L2_CID_AUDIO_BALANCE, drv);
905 if (i >= 0) { 886 if (i >= 0) {
906 aud->balance = i; 887 aud->balance = i;
907 aud->flags |= VIDEO_AUDIO_BALANCE; 888 aud->flags |= VIDEO_AUDIO_BALANCE;
908 } 889 }
909 i = get_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, drv); 890 i = get_v4l_control(file, V4L2_CID_AUDIO_MUTE, drv);
910 if (i >= 0) { 891 if (i >= 0) {
911 if (i) 892 if (i)
912 aud->flags |= VIDEO_AUDIO_MUTE; 893 aud->flags |= VIDEO_AUDIO_MUTE;
@@ -914,13 +895,13 @@ static noinline int v4l1_compat_get_audio(
914 } 895 }
915 aud->step = 1; 896 aud->step = 1;
916 qctrl2.id = V4L2_CID_AUDIO_VOLUME; 897 qctrl2.id = V4L2_CID_AUDIO_VOLUME;
917 if (drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2) == 0 && 898 if (drv(file, VIDIOC_QUERYCTRL, &qctrl2) == 0 &&
918 !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) 899 !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
919 aud->step = qctrl2.step; 900 aud->step = qctrl2.step;
920 aud->mode = 0; 901 aud->mode = 0;
921 902
922 memset(&tun2, 0, sizeof(tun2)); 903 memset(&tun2, 0, sizeof(tun2));
923 err = drv(inode, file, VIDIOC_G_TUNER, &tun2); 904 err = drv(file, VIDIOC_G_TUNER, &tun2);
924 if (err < 0) { 905 if (err < 0) {
925 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err); 906 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err);
926 err = 0; 907 err = 0;
@@ -939,7 +920,6 @@ done:
939 920
940static noinline int v4l1_compat_set_audio( 921static noinline int v4l1_compat_set_audio(
941 struct video_audio *aud, 922 struct video_audio *aud,
942 struct inode *inode,
943 struct file *file, 923 struct file *file,
944 v4l2_kioctl drv) 924 v4l2_kioctl drv)
945{ 925{
@@ -951,24 +931,24 @@ static noinline int v4l1_compat_set_audio(
951 memset(&tun2, 0, sizeof(tun2)); 931 memset(&tun2, 0, sizeof(tun2));
952 932
953 aud2.index = aud->audio; 933 aud2.index = aud->audio;
954 err = drv(inode, file, VIDIOC_S_AUDIO, &aud2); 934 err = drv(file, VIDIOC_S_AUDIO, &aud2);
955 if (err < 0) { 935 if (err < 0) {
956 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err); 936 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err);
957 goto done; 937 goto done;
958 } 938 }
959 939
960 set_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, 940 set_v4l_control(file, V4L2_CID_AUDIO_VOLUME,
961 aud->volume, drv); 941 aud->volume, drv);
962 set_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, 942 set_v4l_control(file, V4L2_CID_AUDIO_BASS,
963 aud->bass, drv); 943 aud->bass, drv);
964 set_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, 944 set_v4l_control(file, V4L2_CID_AUDIO_TREBLE,
965 aud->treble, drv); 945 aud->treble, drv);
966 set_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, 946 set_v4l_control(file, V4L2_CID_AUDIO_BALANCE,
967 aud->balance, drv); 947 aud->balance, drv);
968 set_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, 948 set_v4l_control(file, V4L2_CID_AUDIO_MUTE,
969 !!(aud->flags & VIDEO_AUDIO_MUTE), drv); 949 !!(aud->flags & VIDEO_AUDIO_MUTE), drv);
970 950
971 err = drv(inode, file, VIDIOC_G_TUNER, &tun2); 951 err = drv(file, VIDIOC_G_TUNER, &tun2);
972 if (err < 0) 952 if (err < 0)
973 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err); 953 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err);
974 if (err == 0) { 954 if (err == 0) {
@@ -985,7 +965,7 @@ static noinline int v4l1_compat_set_audio(
985 tun2.audmode = V4L2_TUNER_MODE_LANG2; 965 tun2.audmode = V4L2_TUNER_MODE_LANG2;
986 break; 966 break;
987 } 967 }
988 err = drv(inode, file, VIDIOC_S_TUNER, &tun2); 968 err = drv(file, VIDIOC_S_TUNER, &tun2);
989 if (err < 0) 969 if (err < 0)
990 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err); 970 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err);
991 } 971 }
@@ -996,7 +976,6 @@ done:
996 976
997static noinline int v4l1_compat_capture_frame( 977static noinline int v4l1_compat_capture_frame(
998 struct video_mmap *mm, 978 struct video_mmap *mm,
999 struct inode *inode,
1000 struct file *file, 979 struct file *file,
1001 v4l2_kioctl drv) 980 v4l2_kioctl drv)
1002{ 981{
@@ -1013,7 +992,7 @@ static noinline int v4l1_compat_capture_frame(
1013 memset(&buf, 0, sizeof(buf)); 992 memset(&buf, 0, sizeof(buf));
1014 993
1015 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 994 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1016 err = drv(inode, file, VIDIOC_G_FMT, fmt); 995 err = drv(file, VIDIOC_G_FMT, fmt);
1017 if (err < 0) { 996 if (err < 0) {
1018 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err); 997 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err);
1019 goto done; 998 goto done;
@@ -1029,7 +1008,7 @@ static noinline int v4l1_compat_capture_frame(
1029 palette_to_pixelformat(mm->format); 1008 palette_to_pixelformat(mm->format);
1030 fmt->fmt.pix.field = V4L2_FIELD_ANY; 1009 fmt->fmt.pix.field = V4L2_FIELD_ANY;
1031 fmt->fmt.pix.bytesperline = 0; 1010 fmt->fmt.pix.bytesperline = 0;
1032 err = drv(inode, file, VIDIOC_S_FMT, fmt); 1011 err = drv(file, VIDIOC_S_FMT, fmt);
1033 if (err < 0) { 1012 if (err < 0) {
1034 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err); 1013 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err);
1035 goto done; 1014 goto done;
@@ -1037,17 +1016,17 @@ static noinline int v4l1_compat_capture_frame(
1037 } 1016 }
1038 buf.index = mm->frame; 1017 buf.index = mm->frame;
1039 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1018 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1040 err = drv(inode, file, VIDIOC_QUERYBUF, &buf); 1019 err = drv(file, VIDIOC_QUERYBUF, &buf);
1041 if (err < 0) { 1020 if (err < 0) {
1042 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err); 1021 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err);
1043 goto done; 1022 goto done;
1044 } 1023 }
1045 err = drv(inode, file, VIDIOC_QBUF, &buf); 1024 err = drv(file, VIDIOC_QBUF, &buf);
1046 if (err < 0) { 1025 if (err < 0) {
1047 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err); 1026 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err);
1048 goto done; 1027 goto done;
1049 } 1028 }
1050 err = drv(inode, file, VIDIOC_STREAMON, &captype); 1029 err = drv(file, VIDIOC_STREAMON, &captype);
1051 if (err < 0) 1030 if (err < 0)
1052 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err); 1031 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err);
1053done: 1032done:
@@ -1057,7 +1036,6 @@ done:
1057 1036
1058static noinline int v4l1_compat_sync( 1037static noinline int v4l1_compat_sync(
1059 int *i, 1038 int *i,
1060 struct inode *inode,
1061 struct file *file, 1039 struct file *file,
1062 v4l2_kioctl drv) 1040 v4l2_kioctl drv)
1063{ 1041{
@@ -1069,7 +1047,7 @@ static noinline int v4l1_compat_sync(
1069 memset(&buf, 0, sizeof(buf)); 1047 memset(&buf, 0, sizeof(buf));
1070 buf.index = *i; 1048 buf.index = *i;
1071 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1049 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1072 err = drv(inode, file, VIDIOC_QUERYBUF, &buf); 1050 err = drv(file, VIDIOC_QUERYBUF, &buf);
1073 if (err < 0) { 1051 if (err < 0) {
1074 /* No such buffer */ 1052 /* No such buffer */
1075 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1053 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
@@ -1082,7 +1060,7 @@ static noinline int v4l1_compat_sync(
1082 } 1060 }
1083 1061
1084 /* make sure capture actually runs so we don't block forever */ 1062 /* make sure capture actually runs so we don't block forever */
1085 err = drv(inode, file, VIDIOC_STREAMON, &captype); 1063 err = drv(file, VIDIOC_STREAMON, &captype);
1086 if (err < 0) { 1064 if (err < 0) {
1087 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err); 1065 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err);
1088 goto done; 1066 goto done;
@@ -1096,7 +1074,7 @@ static noinline int v4l1_compat_sync(
1096 if (err < 0 || /* error or sleep was interrupted */ 1074 if (err < 0 || /* error or sleep was interrupted */
1097 err == 0) /* timeout? Shouldn't occur. */ 1075 err == 0) /* timeout? Shouldn't occur. */
1098 break; 1076 break;
1099 err = drv(inode, file, VIDIOC_QUERYBUF, &buf); 1077 err = drv(file, VIDIOC_QUERYBUF, &buf);
1100 if (err < 0) 1078 if (err < 0)
1101 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1079 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
1102 } 1080 }
@@ -1104,7 +1082,7 @@ static noinline int v4l1_compat_sync(
1104 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */ 1082 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
1105 goto done; 1083 goto done;
1106 do { 1084 do {
1107 err = drv(inode, file, VIDIOC_DQBUF, &buf); 1085 err = drv(file, VIDIOC_DQBUF, &buf);
1108 if (err < 0) 1086 if (err < 0)
1109 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err); 1087 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err);
1110 } while (err == 0 && buf.index != *i); 1088 } while (err == 0 && buf.index != *i);
@@ -1114,7 +1092,6 @@ done:
1114 1092
1115static noinline int v4l1_compat_get_vbi_format( 1093static noinline int v4l1_compat_get_vbi_format(
1116 struct vbi_format *fmt, 1094 struct vbi_format *fmt,
1117 struct inode *inode,
1118 struct file *file, 1095 struct file *file,
1119 v4l2_kioctl drv) 1096 v4l2_kioctl drv)
1120{ 1097{
@@ -1128,7 +1105,7 @@ static noinline int v4l1_compat_get_vbi_format(
1128 } 1105 }
1129 fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE; 1106 fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
1130 1107
1131 err = drv(inode, file, VIDIOC_G_FMT, fmt2); 1108 err = drv(file, VIDIOC_G_FMT, fmt2);
1132 if (err < 0) { 1109 if (err < 0) {
1133 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); 1110 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err);
1134 goto done; 1111 goto done;
@@ -1153,7 +1130,6 @@ done:
1153 1130
1154static noinline int v4l1_compat_set_vbi_format( 1131static noinline int v4l1_compat_set_vbi_format(
1155 struct vbi_format *fmt, 1132 struct vbi_format *fmt,
1156 struct inode *inode,
1157 struct file *file, 1133 struct file *file,
1158 v4l2_kioctl drv) 1134 v4l2_kioctl drv)
1159{ 1135{
@@ -1179,7 +1155,7 @@ static noinline int v4l1_compat_set_vbi_format(
1179 fmt2->fmt.vbi.start[1] = fmt->start[1]; 1155 fmt2->fmt.vbi.start[1] = fmt->start[1];
1180 fmt2->fmt.vbi.count[1] = fmt->count[1]; 1156 fmt2->fmt.vbi.count[1] = fmt->count[1];
1181 fmt2->fmt.vbi.flags = fmt->flags; 1157 fmt2->fmt.vbi.flags = fmt->flags;
1182 err = drv(inode, file, VIDIOC_TRY_FMT, fmt2); 1158 err = drv(file, VIDIOC_TRY_FMT, fmt2);
1183 if (err < 0) { 1159 if (err < 0) {
1184 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err); 1160 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err);
1185 goto done; 1161 goto done;
@@ -1196,7 +1172,7 @@ static noinline int v4l1_compat_set_vbi_format(
1196 err = -EINVAL; 1172 err = -EINVAL;
1197 goto done; 1173 goto done;
1198 } 1174 }
1199 err = drv(inode, file, VIDIOC_S_FMT, fmt2); 1175 err = drv(file, VIDIOC_S_FMT, fmt2);
1200 if (err < 0) 1176 if (err < 0)
1201 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err); 1177 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
1202done: 1178done:
@@ -1208,8 +1184,7 @@ done:
1208 * This function is exported. 1184 * This function is exported.
1209 */ 1185 */
1210int 1186int
1211v4l_compat_translate_ioctl(struct inode *inode, 1187v4l_compat_translate_ioctl(struct file *file,
1212 struct file *file,
1213 int cmd, 1188 int cmd,
1214 void *arg, 1189 void *arg,
1215 v4l2_kioctl drv) 1190 v4l2_kioctl drv)
@@ -1218,64 +1193,64 @@ v4l_compat_translate_ioctl(struct inode *inode,
1218 1193
1219 switch (cmd) { 1194 switch (cmd) {
1220 case VIDIOCGCAP: /* capability */ 1195 case VIDIOCGCAP: /* capability */
1221 err = v4l1_compat_get_capabilities(arg, inode, file, drv); 1196 err = v4l1_compat_get_capabilities(arg, file, drv);
1222 break; 1197 break;
1223 case VIDIOCGFBUF: /* get frame buffer */ 1198 case VIDIOCGFBUF: /* get frame buffer */
1224 err = v4l1_compat_get_frame_buffer(arg, inode, file, drv); 1199 err = v4l1_compat_get_frame_buffer(arg, file, drv);
1225 break; 1200 break;
1226 case VIDIOCSFBUF: /* set frame buffer */ 1201 case VIDIOCSFBUF: /* set frame buffer */
1227 err = v4l1_compat_set_frame_buffer(arg, inode, file, drv); 1202 err = v4l1_compat_set_frame_buffer(arg, file, drv);
1228 break; 1203 break;
1229 case VIDIOCGWIN: /* get window or capture dimensions */ 1204 case VIDIOCGWIN: /* get window or capture dimensions */
1230 err = v4l1_compat_get_win_cap_dimensions(arg, inode, file, drv); 1205 err = v4l1_compat_get_win_cap_dimensions(arg, file, drv);
1231 break; 1206 break;
1232 case VIDIOCSWIN: /* set window and/or capture dimensions */ 1207 case VIDIOCSWIN: /* set window and/or capture dimensions */
1233 err = v4l1_compat_set_win_cap_dimensions(arg, inode, file, drv); 1208 err = v4l1_compat_set_win_cap_dimensions(arg, file, drv);
1234 break; 1209 break;
1235 case VIDIOCCAPTURE: /* turn on/off preview */ 1210 case VIDIOCCAPTURE: /* turn on/off preview */
1236 err = v4l1_compat_turn_preview_on_off(arg, inode, file, drv); 1211 err = v4l1_compat_turn_preview_on_off(arg, file, drv);
1237 break; 1212 break;
1238 case VIDIOCGCHAN: /* get input information */ 1213 case VIDIOCGCHAN: /* get input information */
1239 err = v4l1_compat_get_input_info(arg, inode, file, drv); 1214 err = v4l1_compat_get_input_info(arg, file, drv);
1240 break; 1215 break;
1241 case VIDIOCSCHAN: /* set input */ 1216 case VIDIOCSCHAN: /* set input */
1242 err = v4l1_compat_set_input(arg, inode, file, drv); 1217 err = v4l1_compat_set_input(arg, file, drv);
1243 break; 1218 break;
1244 case VIDIOCGPICT: /* get tone controls & partial capture format */ 1219 case VIDIOCGPICT: /* get tone controls & partial capture format */
1245 err = v4l1_compat_get_picture(arg, inode, file, drv); 1220 err = v4l1_compat_get_picture(arg, file, drv);
1246 break; 1221 break;
1247 case VIDIOCSPICT: /* set tone controls & partial capture format */ 1222 case VIDIOCSPICT: /* set tone controls & partial capture format */
1248 err = v4l1_compat_set_picture(arg, inode, file, drv); 1223 err = v4l1_compat_set_picture(arg, file, drv);
1249 break; 1224 break;
1250 case VIDIOCGTUNER: /* get tuner information */ 1225 case VIDIOCGTUNER: /* get tuner information */
1251 err = v4l1_compat_get_tuner(arg, inode, file, drv); 1226 err = v4l1_compat_get_tuner(arg, file, drv);
1252 break; 1227 break;
1253 case VIDIOCSTUNER: /* select a tuner input */ 1228 case VIDIOCSTUNER: /* select a tuner input */
1254 err = v4l1_compat_select_tuner(arg, inode, file, drv); 1229 err = v4l1_compat_select_tuner(arg, file, drv);
1255 break; 1230 break;
1256 case VIDIOCGFREQ: /* get frequency */ 1231 case VIDIOCGFREQ: /* get frequency */
1257 err = v4l1_compat_get_frequency(arg, inode, file, drv); 1232 err = v4l1_compat_get_frequency(arg, file, drv);
1258 break; 1233 break;
1259 case VIDIOCSFREQ: /* set frequency */ 1234 case VIDIOCSFREQ: /* set frequency */
1260 err = v4l1_compat_set_frequency(arg, inode, file, drv); 1235 err = v4l1_compat_set_frequency(arg, file, drv);
1261 break; 1236 break;
1262 case VIDIOCGAUDIO: /* get audio properties/controls */ 1237 case VIDIOCGAUDIO: /* get audio properties/controls */
1263 err = v4l1_compat_get_audio(arg, inode, file, drv); 1238 err = v4l1_compat_get_audio(arg, file, drv);
1264 break; 1239 break;
1265 case VIDIOCSAUDIO: /* set audio controls */ 1240 case VIDIOCSAUDIO: /* set audio controls */
1266 err = v4l1_compat_set_audio(arg, inode, file, drv); 1241 err = v4l1_compat_set_audio(arg, file, drv);
1267 break; 1242 break;
1268 case VIDIOCMCAPTURE: /* capture a frame */ 1243 case VIDIOCMCAPTURE: /* capture a frame */
1269 err = v4l1_compat_capture_frame(arg, inode, file, drv); 1244 err = v4l1_compat_capture_frame(arg, file, drv);
1270 break; 1245 break;
1271 case VIDIOCSYNC: /* wait for a frame */ 1246 case VIDIOCSYNC: /* wait for a frame */
1272 err = v4l1_compat_sync(arg, inode, file, drv); 1247 err = v4l1_compat_sync(arg, file, drv);
1273 break; 1248 break;
1274 case VIDIOCGVBIFMT: /* query VBI data capture format */ 1249 case VIDIOCGVBIFMT: /* query VBI data capture format */
1275 err = v4l1_compat_get_vbi_format(arg, inode, file, drv); 1250 err = v4l1_compat_get_vbi_format(arg, file, drv);
1276 break; 1251 break;
1277 case VIDIOCSVBIFMT: 1252 case VIDIOCSVBIFMT:
1278 err = v4l1_compat_set_vbi_format(arg, inode, file, drv); 1253 err = v4l1_compat_set_vbi_format(arg, file, drv);
1279 break; 1254 break;
1280 default: 1255 default:
1281 err = -ENOIOCTLCMD; 1256 err = -ENOIOCTLCMD;
diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
index 0e4549922f26..a935bae538ef 100644
--- a/drivers/media/video/v4l2-int-device.c
+++ b/drivers/media/video/v4l2-int-device.c
@@ -32,7 +32,7 @@
32static DEFINE_MUTEX(mutex); 32static DEFINE_MUTEX(mutex);
33static LIST_HEAD(int_list); 33static LIST_HEAD(int_list);
34 34
35static void v4l2_int_device_try_attach_all(void) 35void v4l2_int_device_try_attach_all(void)
36{ 36{
37 struct v4l2_int_device *m, *s; 37 struct v4l2_int_device *m, *s;
38 38
@@ -66,6 +66,7 @@ static void v4l2_int_device_try_attach_all(void)
66 } 66 }
67 } 67 }
68} 68}
69EXPORT_SYMBOL_GPL(v4l2_int_device_try_attach_all);
69 70
70static int ioctl_sort_cmp(const void *a, const void *b) 71static int ioctl_sort_cmp(const void *a, const void *b)
71{ 72{
@@ -144,6 +145,7 @@ int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd)
144 find_ioctl(d->u.slave, cmd, 145 find_ioctl(d->u.slave, cmd,
145 (v4l2_int_ioctl_func *)no_such_ioctl_0))(d); 146 (v4l2_int_ioctl_func *)no_such_ioctl_0))(d);
146} 147}
148EXPORT_SYMBOL_GPL(v4l2_int_ioctl_0);
147 149
148static int no_such_ioctl_1(struct v4l2_int_device *d, void *arg) 150static int no_such_ioctl_1(struct v4l2_int_device *d, void *arg)
149{ 151{
@@ -156,5 +158,6 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg)
156 find_ioctl(d->u.slave, cmd, 158 find_ioctl(d->u.slave, cmd,
157 (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg); 159 (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg);
158} 160}
161EXPORT_SYMBOL_GPL(v4l2_int_ioctl_1);
159 162
160MODULE_LICENSE("GPL"); 163MODULE_LICENSE("GPL");
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 155c9d77a463..710e1a40c422 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -625,13 +625,13 @@ static int check_fmt(const struct v4l2_ioctl_ops *ops, enum v4l2_buf_type type)
625 return -EINVAL; 625 return -EINVAL;
626} 626}
627 627
628static int __video_do_ioctl(struct inode *inode, struct file *file, 628static int __video_do_ioctl(struct file *file,
629 unsigned int cmd, void *arg) 629 unsigned int cmd, void *arg)
630{ 630{
631 struct video_device *vfd = video_devdata(file); 631 struct video_device *vfd = video_devdata(file);
632 const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops; 632 const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
633 void *fh = file->private_data; 633 void *fh = file->private_data;
634 int ret = -EINVAL; 634 int ret = -EINVAL;
635 635
636 if ((vfd->debug & V4L2_DEBUG_IOCTL) && 636 if ((vfd->debug & V4L2_DEBUG_IOCTL) &&
637 !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) { 637 !(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) {
@@ -675,7 +675,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
675 V4L2 ioctls. 675 V4L2 ioctls.
676 ********************************************************/ 676 ********************************************************/
677 if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE) 677 if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE)
678 return v4l_compat_translate_ioctl(inode, file, cmd, arg, 678 return v4l_compat_translate_ioctl(file, cmd, arg,
679 __video_do_ioctl); 679 __video_do_ioctl);
680#endif 680#endif
681 681
@@ -1768,7 +1768,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
1768 return ret; 1768 return ret;
1769} 1769}
1770 1770
1771int video_ioctl2(struct inode *inode, struct file *file, 1771int __video_ioctl2(struct file *file,
1772 unsigned int cmd, unsigned long arg) 1772 unsigned int cmd, unsigned long arg)
1773{ 1773{
1774 char sbuf[128]; 1774 char sbuf[128];
@@ -1832,7 +1832,7 @@ int video_ioctl2(struct inode *inode, struct file *file,
1832 } 1832 }
1833 1833
1834 /* Handles IOCTL */ 1834 /* Handles IOCTL */
1835 err = __video_do_ioctl(inode, file, cmd, parg); 1835 err = __video_do_ioctl(file, cmd, parg);
1836 if (err == -ENOIOCTLCMD) 1836 if (err == -ENOIOCTLCMD)
1837 err = -EINVAL; 1837 err = -EINVAL;
1838 if (is_ext_ctrl) { 1838 if (is_ext_ctrl) {
@@ -1860,4 +1860,11 @@ out:
1860 kfree(mbuf); 1860 kfree(mbuf);
1861 return err; 1861 return err;
1862} 1862}
1863EXPORT_SYMBOL(__video_ioctl2);
1864
1865int video_ioctl2(struct inode *inode, struct file *file,
1866 unsigned int cmd, unsigned long arg)
1867{
1868 return __video_ioctl2(file, cmd, arg);
1869}
1863EXPORT_SYMBOL(video_ioctl2); 1870EXPORT_SYMBOL(video_ioctl2);
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c
index 917277d36605..0e7dcba8e4ae 100644
--- a/drivers/media/video/videobuf-dvb.c
+++ b/drivers/media/video/videobuf-dvb.c
@@ -296,29 +296,7 @@ EXPORT_SYMBOL(videobuf_dvb_register_bus);
296 296
297void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f) 297void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f)
298{ 298{
299 struct list_head *list, *q; 299 videobuf_dvb_dealloc_frontends(f);
300 struct videobuf_dvb_frontend *fe;
301
302 mutex_lock(&f->lock);
303 list_for_each_safe(list, q, &f->felist) {
304 fe = list_entry(list, struct videobuf_dvb_frontend, felist);
305 if (fe->dvb.net.dvbdev) {
306 dvb_net_release(&fe->dvb.net);
307 fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
308 &fe->dvb.fe_mem);
309 fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
310 &fe->dvb.fe_hw);
311 dvb_dmxdev_release(&fe->dvb.dmxdev);
312 dvb_dmx_release(&fe->dvb.demux);
313 dvb_unregister_frontend(fe->dvb.frontend);
314 }
315 if (fe->dvb.frontend)
316 /* always allocated, may have been reset */
317 dvb_frontend_detach(fe->dvb.frontend);
318 list_del(list);
319 kfree(fe);
320 }
321 mutex_unlock(&f->lock);
322 300
323 dvb_unregister_adapter(&f->adapter); 301 dvb_unregister_adapter(&f->adapter);
324} 302}
@@ -389,3 +367,31 @@ fail_alloc:
389 return fe; 367 return fe;
390} 368}
391EXPORT_SYMBOL(videobuf_dvb_alloc_frontend); 369EXPORT_SYMBOL(videobuf_dvb_alloc_frontend);
370
371void videobuf_dvb_dealloc_frontends(struct videobuf_dvb_frontends *f)
372{
373 struct list_head *list, *q;
374 struct videobuf_dvb_frontend *fe;
375
376 mutex_lock(&f->lock);
377 list_for_each_safe(list, q, &f->felist) {
378 fe = list_entry(list, struct videobuf_dvb_frontend, felist);
379 if (fe->dvb.net.dvbdev) {
380 dvb_net_release(&fe->dvb.net);
381 fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
382 &fe->dvb.fe_mem);
383 fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
384 &fe->dvb.fe_hw);
385 dvb_dmxdev_release(&fe->dvb.dmxdev);
386 dvb_dmx_release(&fe->dvb.demux);
387 dvb_unregister_frontend(fe->dvb.frontend);
388 }
389 if (fe->dvb.frontend)
390 /* always allocated, may have been reset */
391 dvb_frontend_detach(fe->dvb.frontend);
392 list_del(list); /* remove list entry */
393 kfree(fe); /* free frontend allocation */
394 }
395 mutex_unlock(&f->lock);
396}
397EXPORT_SYMBOL(videobuf_dvb_dealloc_frontends);
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 7d7e51def461..e15e48f04be7 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1163,11 +1163,11 @@ static int vivi_release(void)
1163 1163
1164 if (-1 != dev->vfd->minor) { 1164 if (-1 != dev->vfd->minor) {
1165 printk(KERN_INFO "%s: unregistering /dev/video%d\n", 1165 printk(KERN_INFO "%s: unregistering /dev/video%d\n",
1166 VIVI_MODULE_NAME, dev->vfd->minor); 1166 VIVI_MODULE_NAME, dev->vfd->num);
1167 video_unregister_device(dev->vfd); 1167 video_unregister_device(dev->vfd);
1168 } else { 1168 } else {
1169 printk(KERN_INFO "%s: releasing /dev/video%d\n", 1169 printk(KERN_INFO "%s: releasing /dev/video%d\n",
1170 VIVI_MODULE_NAME, dev->vfd->minor); 1170 VIVI_MODULE_NAME, dev->vfd->num);
1171 video_device_release(dev->vfd); 1171 video_device_release(dev->vfd);
1172 } 1172 }
1173 1173
@@ -1307,7 +1307,7 @@ static int __init vivi_init(void)
1307 1307
1308 dev->vfd = vfd; 1308 dev->vfd = vfd;
1309 printk(KERN_INFO "%s: V4L2 device registered as /dev/video%d\n", 1309 printk(KERN_INFO "%s: V4L2 device registered as /dev/video%d\n",
1310 VIVI_MODULE_NAME, vfd->minor); 1310 VIVI_MODULE_NAME, vfd->num);
1311 } 1311 }
1312 1312
1313 if (ret < 0) { 1313 if (ret < 0) {
diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
index dcd45dbd82dc..4dfb43bd1846 100644
--- a/drivers/media/video/w9968cf.c
+++ b/drivers/media/video/w9968cf.c
@@ -2398,7 +2398,7 @@ error:
2398 cam->sensor = CC_UNKNOWN; 2398 cam->sensor = CC_UNKNOWN;
2399 DBG(1, "Image sensor initialization failed for %s (/dev/video%d). " 2399 DBG(1, "Image sensor initialization failed for %s (/dev/video%d). "
2400 "Try to detach and attach this device again", 2400 "Try to detach and attach this device again",
2401 symbolic(camlist, cam->id), cam->v4ldev->minor) 2401 symbolic(camlist, cam->id), cam->v4ldev->num)
2402 return err; 2402 return err;
2403} 2403}
2404 2404
@@ -2644,7 +2644,7 @@ static void w9968cf_release_resources(struct w9968cf_device* cam)
2644{ 2644{
2645 mutex_lock(&w9968cf_devlist_mutex); 2645 mutex_lock(&w9968cf_devlist_mutex);
2646 2646
2647 DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->minor) 2647 DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->num)
2648 2648
2649 video_unregister_device(cam->v4ldev); 2649 video_unregister_device(cam->v4ldev);
2650 list_del(&cam->v4llist); 2650 list_del(&cam->v4llist);
@@ -2679,7 +2679,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
2679 DBG(2, "No supported image sensor has been detected by the " 2679 DBG(2, "No supported image sensor has been detected by the "
2680 "'ovcamchip' module for the %s (/dev/video%d). Make " 2680 "'ovcamchip' module for the %s (/dev/video%d). Make "
2681 "sure it is loaded *before* (re)connecting the camera.", 2681 "sure it is loaded *before* (re)connecting the camera.",
2682 symbolic(camlist, cam->id), cam->v4ldev->minor) 2682 symbolic(camlist, cam->id), cam->v4ldev->num)
2683 mutex_unlock(&cam->dev_mutex); 2683 mutex_unlock(&cam->dev_mutex);
2684 up_read(&w9968cf_disconnect); 2684 up_read(&w9968cf_disconnect);
2685 return -ENODEV; 2685 return -ENODEV;
@@ -2687,7 +2687,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
2687 2687
2688 if (cam->users) { 2688 if (cam->users) {
2689 DBG(2, "%s (/dev/video%d) has been already occupied by '%s'", 2689 DBG(2, "%s (/dev/video%d) has been already occupied by '%s'",
2690 symbolic(camlist, cam->id),cam->v4ldev->minor,cam->command) 2690 symbolic(camlist, cam->id), cam->v4ldev->num, cam->command)
2691 if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) { 2691 if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) {
2692 mutex_unlock(&cam->dev_mutex); 2692 mutex_unlock(&cam->dev_mutex);
2693 up_read(&w9968cf_disconnect); 2693 up_read(&w9968cf_disconnect);
@@ -2709,7 +2709,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
2709 } 2709 }
2710 2710
2711 DBG(5, "Opening '%s', /dev/video%d ...", 2711 DBG(5, "Opening '%s', /dev/video%d ...",
2712 symbolic(camlist, cam->id), cam->v4ldev->minor) 2712 symbolic(camlist, cam->id), cam->v4ldev->num)
2713 2713
2714 cam->streaming = 0; 2714 cam->streaming = 0;
2715 cam->misconfigured = 0; 2715 cam->misconfigured = 0;
@@ -2947,7 +2947,7 @@ static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
2947 .minheight = cam->minheight, 2947 .minheight = cam->minheight,
2948 }; 2948 };
2949 sprintf(cap.name, "W996[87]CF USB Camera #%d", 2949 sprintf(cap.name, "W996[87]CF USB Camera #%d",
2950 cam->v4ldev->minor); 2950 cam->v4ldev->num);
2951 cap.maxwidth = (cam->upscaling && w9968cf_vpp) 2951 cap.maxwidth = (cam->upscaling && w9968cf_vpp)
2952 ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth) 2952 ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth)
2953 : cam->maxwidth; 2953 : cam->maxwidth;
@@ -3567,7 +3567,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
3567 goto fail; 3567 goto fail;
3568 } 3568 }
3569 3569
3570 DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev->minor) 3570 DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev->num)
3571 3571
3572 /* Set some basic constants */ 3572 /* Set some basic constants */
3573 w9968cf_configure_camera(cam, udev, mod_id, dev_nr); 3573 w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
@@ -3618,7 +3618,7 @@ static void w9968cf_usb_disconnect(struct usb_interface* intf)
3618 DBG(2, "The device is open (/dev/video%d)! " 3618 DBG(2, "The device is open (/dev/video%d)! "
3619 "Process name: %s. Deregistration and memory " 3619 "Process name: %s. Deregistration and memory "
3620 "deallocation are deferred on close.", 3620 "deallocation are deferred on close.",
3621 cam->v4ldev->minor, cam->command) 3621 cam->v4ldev->num, cam->command)
3622 cam->misconfigured = 1; 3622 cam->misconfigured = 1;
3623 w9968cf_stop_transfer(cam); 3623 w9968cf_stop_transfer(cam);
3624 wake_up_interruptible(&cam->wait_queue); 3624 wake_up_interruptible(&cam->wait_queue);
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index 6a0902bcba6b..9fc581707638 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -539,7 +539,7 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
539 cam->state |= DEV_MISCONFIGURED; 539 cam->state |= DEV_MISCONFIGURED;
540 DBG(1, "URB timeout reached. The camera is misconfigured. To " 540 DBG(1, "URB timeout reached. The camera is misconfigured. To "
541 "use it, close and open /dev/video%d again.", 541 "use it, close and open /dev/video%d again.",
542 cam->v4ldev->minor); 542 cam->v4ldev->num);
543 return -EIO; 543 return -EIO;
544 } 544 }
545 545
@@ -640,7 +640,7 @@ static void zc0301_release_resources(struct kref *kref)
640{ 640{
641 struct zc0301_device *cam = container_of(kref, struct zc0301_device, 641 struct zc0301_device *cam = container_of(kref, struct zc0301_device,
642 kref); 642 kref);
643 DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor); 643 DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
644 video_set_drvdata(cam->v4ldev, NULL); 644 video_set_drvdata(cam->v4ldev, NULL);
645 video_unregister_device(cam->v4ldev); 645 video_unregister_device(cam->v4ldev);
646 usb_put_dev(cam->usbdev); 646 usb_put_dev(cam->usbdev);
@@ -679,7 +679,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
679 } 679 }
680 680
681 if (cam->users) { 681 if (cam->users) {
682 DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->minor); 682 DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->num);
683 DBG(3, "Simultaneous opens are not supported"); 683 DBG(3, "Simultaneous opens are not supported");
684 if ((filp->f_flags & O_NONBLOCK) || 684 if ((filp->f_flags & O_NONBLOCK) ||
685 (filp->f_flags & O_NDELAY)) { 685 (filp->f_flags & O_NDELAY)) {
@@ -722,7 +722,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
722 cam->frame_count = 0; 722 cam->frame_count = 0;
723 zc0301_empty_framequeues(cam); 723 zc0301_empty_framequeues(cam);
724 724
725 DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor); 725 DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
726 726
727out: 727out:
728 mutex_unlock(&cam->open_mutex); 728 mutex_unlock(&cam->open_mutex);
@@ -746,7 +746,7 @@ static int zc0301_release(struct inode* inode, struct file* filp)
746 cam->users--; 746 cam->users--;
747 wake_up_interruptible_nr(&cam->wait_open, 1); 747 wake_up_interruptible_nr(&cam->wait_open, 1);
748 748
749 DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor); 749 DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
750 750
751 kref_put(&cam->kref, zc0301_release_resources); 751 kref_put(&cam->kref, zc0301_release_resources);
752 752
@@ -1275,7 +1275,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
1275 cam->state |= DEV_MISCONFIGURED; 1275 cam->state |= DEV_MISCONFIGURED;
1276 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " 1276 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
1277 "use the camera, close and open /dev/video%d again.", 1277 "use the camera, close and open /dev/video%d again.",
1278 cam->v4ldev->minor); 1278 cam->v4ldev->num);
1279 return -EIO; 1279 return -EIO;
1280 } 1280 }
1281 1281
@@ -1288,7 +1288,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
1288 cam->state |= DEV_MISCONFIGURED; 1288 cam->state |= DEV_MISCONFIGURED;
1289 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " 1289 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
1290 "use the camera, close and open /dev/video%d again.", 1290 "use the camera, close and open /dev/video%d again.",
1291 cam->v4ldev->minor); 1291 cam->v4ldev->num);
1292 return -ENOMEM; 1292 return -ENOMEM;
1293 } 1293 }
1294 1294
@@ -1470,7 +1470,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
1470 cam->state |= DEV_MISCONFIGURED; 1470 cam->state |= DEV_MISCONFIGURED;
1471 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " 1471 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
1472 "use the camera, close and open /dev/video%d again.", 1472 "use the camera, close and open /dev/video%d again.",
1473 cam->v4ldev->minor); 1473 cam->v4ldev->num);
1474 return -EIO; 1474 return -EIO;
1475 } 1475 }
1476 1476
@@ -1482,7 +1482,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
1482 cam->state |= DEV_MISCONFIGURED; 1482 cam->state |= DEV_MISCONFIGURED;
1483 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " 1483 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
1484 "use the camera, close and open /dev/video%d again.", 1484 "use the camera, close and open /dev/video%d again.",
1485 cam->v4ldev->minor); 1485 cam->v4ldev->num);
1486 return -ENOMEM; 1486 return -ENOMEM;
1487 } 1487 }
1488 1488
@@ -1529,7 +1529,7 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_device* cam, void __user * arg)
1529 cam->state |= DEV_MISCONFIGURED; 1529 cam->state |= DEV_MISCONFIGURED;
1530 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " 1530 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
1531 "problems. To use the camera, close and open " 1531 "problems. To use the camera, close and open "
1532 "/dev/video%d again.", cam->v4ldev->minor); 1532 "/dev/video%d again.", cam->v4ldev->num);
1533 return -EIO; 1533 return -EIO;
1534 } 1534 }
1535 1535
@@ -2005,7 +2005,7 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2005 goto fail; 2005 goto fail;
2006 } 2006 }
2007 2007
2008 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor); 2008 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
2009 2009
2010 cam->module_param.force_munmap = force_munmap[dev_nr]; 2010 cam->module_param.force_munmap = force_munmap[dev_nr];
2011 cam->module_param.frame_timeout = frame_timeout[dev_nr]; 2011 cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2044,7 +2044,7 @@ static void zc0301_usb_disconnect(struct usb_interface* intf)
2044 if (cam->users) { 2044 if (cam->users) {
2045 DBG(2, "Device /dev/video%d is open! Deregistration and " 2045 DBG(2, "Device /dev/video%d is open! Deregistration and "
2046 "memory deallocation are deferred.", 2046 "memory deallocation are deferred.",
2047 cam->v4ldev->minor); 2047 cam->v4ldev->num);
2048 cam->state |= DEV_MISCONFIGURED; 2048 cam->state |= DEV_MISCONFIGURED;
2049 zc0301_stop_transfer(cam); 2049 zc0301_stop_transfer(cam);
2050 cam->state |= DEV_DISCONNECTED; 2050 cam->state |= DEV_DISCONNECTED;
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index 7cdac99deea6..a1d81ed44c7c 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -885,7 +885,7 @@ static int zr364xx_probe(struct usb_interface *intf,
885 usb_set_intfdata(intf, cam); 885 usb_set_intfdata(intf, cam);
886 886
887 dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n", 887 dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n",
888 cam->vdev->minor); 888 cam->vdev->num);
889 return 0; 889 return 0;
890} 890}
891 891
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d4b03034ee73..4669d7e72e75 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -315,6 +315,13 @@ struct v4l2_pix_format {
315/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ 315/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
316#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 316#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
317#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ 317#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
318/*
319 * 10bit raw bayer, expanded to 16 bits
320 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
321 */
322#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0')
323/* 10bit raw bayer DPCM compressed to 8 bits */
324#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
318#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ 325#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
319 326
320/* compressed formats */ 327/* compressed formats */
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index c8b80e0f0651..9c2df41dbf92 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -84,6 +84,8 @@ struct v4l2_int_device {
84 void *priv; 84 void *priv;
85}; 85};
86 86
87void v4l2_int_device_try_attach_all(void);
88
87int v4l2_int_device_register(struct v4l2_int_device *d); 89int v4l2_int_device_register(struct v4l2_int_device *d);
88void v4l2_int_device_unregister(struct v4l2_int_device *d); 90void v4l2_int_device_unregister(struct v4l2_int_device *d);
89 91
@@ -96,6 +98,12 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg);
96 * 98 *
97 */ 99 */
98 100
101enum v4l2_power {
102 V4L2_POWER_OFF = 0,
103 V4L2_POWER_ON,
104 V4L2_POWER_STANDBY,
105};
106
99/* Slave interface type. */ 107/* Slave interface type. */
100enum v4l2_if_type { 108enum v4l2_if_type {
101 /* 109 /*
@@ -170,6 +178,9 @@ enum v4l2_int_ioctl_num {
170 vidioc_int_queryctrl_num, 178 vidioc_int_queryctrl_num,
171 vidioc_int_g_ctrl_num, 179 vidioc_int_g_ctrl_num,
172 vidioc_int_s_ctrl_num, 180 vidioc_int_s_ctrl_num,
181 vidioc_int_cropcap_num,
182 vidioc_int_g_crop_num,
183 vidioc_int_s_crop_num,
173 vidioc_int_g_parm_num, 184 vidioc_int_g_parm_num,
174 vidioc_int_s_parm_num, 185 vidioc_int_s_parm_num,
175 186
@@ -182,12 +193,19 @@ enum v4l2_int_ioctl_num {
182 vidioc_int_dev_init_num = 1000, 193 vidioc_int_dev_init_num = 1000,
183 /* Delinitialise the device at slave detach. */ 194 /* Delinitialise the device at slave detach. */
184 vidioc_int_dev_exit_num, 195 vidioc_int_dev_exit_num,
185 /* Set device power state: 0 is off, non-zero is on. */ 196 /* Set device power state. */
186 vidioc_int_s_power_num, 197 vidioc_int_s_power_num,
198 /*
199 * Get slave private data, e.g. platform-specific slave
200 * configuration used by the master.
201 */
202 vidioc_int_g_priv_num,
187 /* Get slave interface parameters. */ 203 /* Get slave interface parameters. */
188 vidioc_int_g_ifparm_num, 204 vidioc_int_g_ifparm_num,
189 /* Does the slave need to be reset after VIDIOC_DQBUF? */ 205 /* Does the slave need to be reset after VIDIOC_DQBUF? */
190 vidioc_int_g_needs_reset_num, 206 vidioc_int_g_needs_reset_num,
207 vidioc_int_enum_framesizes_num,
208 vidioc_int_enum_frameintervals_num,
191 209
192 /* 210 /*
193 * 211 *
@@ -261,14 +279,20 @@ V4L2_INT_WRAPPER_1(try_fmt_cap, struct v4l2_format, *);
261V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *); 279V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *);
262V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *); 280V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *);
263V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *); 281V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *);
282V4L2_INT_WRAPPER_1(cropcap, struct v4l2_cropcap, *);
283V4L2_INT_WRAPPER_1(g_crop, struct v4l2_crop, *);
284V4L2_INT_WRAPPER_1(s_crop, struct v4l2_crop, *);
264V4L2_INT_WRAPPER_1(g_parm, struct v4l2_streamparm, *); 285V4L2_INT_WRAPPER_1(g_parm, struct v4l2_streamparm, *);
265V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *); 286V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *);
266 287
267V4L2_INT_WRAPPER_0(dev_init); 288V4L2_INT_WRAPPER_0(dev_init);
268V4L2_INT_WRAPPER_0(dev_exit); 289V4L2_INT_WRAPPER_0(dev_exit);
269V4L2_INT_WRAPPER_1(s_power, int, ); 290V4L2_INT_WRAPPER_1(s_power, enum v4l2_power, );
291V4L2_INT_WRAPPER_1(g_priv, void, *);
270V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *); 292V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *);
271V4L2_INT_WRAPPER_1(g_needs_reset, void, *); 293V4L2_INT_WRAPPER_1(g_needs_reset, void, *);
294V4L2_INT_WRAPPER_1(enum_framesizes, struct v4l2_frmsizeenum, *);
295V4L2_INT_WRAPPER_1(enum_frameintervals, struct v4l2_frmivalenum, *);
272 296
273V4L2_INT_WRAPPER_0(reset); 297V4L2_INT_WRAPPER_0(reset);
274V4L2_INT_WRAPPER_0(init); 298V4L2_INT_WRAPPER_0(init);
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index 0bef03add796..e6ba25b3d7c8 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -271,26 +271,38 @@ extern const char *v4l2_field_names[];
271extern const char *v4l2_type_names[]; 271extern const char *v4l2_type_names[];
272 272
273/* Compatibility layer interface -- v4l1-compat module */ 273/* Compatibility layer interface -- v4l1-compat module */
274typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, 274typedef int (*v4l2_kioctl)(struct file *file,
275 unsigned int cmd, void *arg); 275 unsigned int cmd, void *arg);
276#ifdef CONFIG_VIDEO_V4L1_COMPAT 276#ifdef CONFIG_VIDEO_V4L1_COMPAT
277int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, 277int v4l_compat_translate_ioctl(struct file *file,
278 int cmd, void *arg, v4l2_kioctl driver_ioctl); 278 int cmd, void *arg, v4l2_kioctl driver_ioctl);
279#else 279#else
280#define v4l_compat_translate_ioctl(inode, file, cmd, arg, ioctl) (-EINVAL) 280#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL)
281#endif 281#endif
282 282
283/* 32 Bits compatibility layer for 64 bits processors */ 283/* 32 Bits compatibility layer for 64 bits processors */
284extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, 284extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
285 unsigned long arg); 285 unsigned long arg);
286 286
287extern int video_ioctl2(struct inode *inode, struct file *file,
288 unsigned int cmd, unsigned long arg);
289
290/* Include support for obsoleted stuff */ 287/* Include support for obsoleted stuff */
291extern int video_usercopy(struct inode *inode, struct file *file, 288extern int video_usercopy(struct inode *inode, struct file *file,
292 unsigned int cmd, unsigned long arg, 289 unsigned int cmd, unsigned long arg,
293 int (*func)(struct inode *inode, struct file *file, 290 int (*func)(struct inode *inode, struct file *file,
294 unsigned int cmd, void *arg)); 291 unsigned int cmd, void *arg));
295 292
293/* Standard handlers for V4L ioctl's */
294
295/* This prototype is used on fops.unlocked_ioctl */
296extern int __video_ioctl2(struct file *file,
297 unsigned int cmd, unsigned long arg);
298
299/* This prototype is used on fops.ioctl
300 * Since fops.ioctl enables Kernel Big Lock, it is preferred
301 * to use __video_ioctl2 instead.
302 * It should be noticed that there's no lock code inside
303 * video_ioctl2().
304 */
305extern int video_ioctl2(struct inode *inode, struct file *file,
306 unsigned int cmd, unsigned long arg);
307
296#endif /* _V4L2_IOCTL_H */ 308#endif /* _V4L2_IOCTL_H */
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h
index 80471c2b6343..6ba4f1271d23 100644
--- a/include/media/videobuf-dvb.h
+++ b/include/media/videobuf-dvb.h
@@ -47,6 +47,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
47void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); 47void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);
48 48
49struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id); 49struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id);
50void videobuf_dvb_dealloc_frontends(struct videobuf_dvb_frontends *f);
50 51
51struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id); 52struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id);
52int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p); 53int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p);