Browse Source

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (36 commits)
  V4L/DVB (9336): cx88: always de-alloc frontends on fault condition
  V4L/DVB (9335): videobuf: split unregister bus creating self-contained frontend de-allocator
  V4L/DVB (9334): cx88: dvb_remove debug output
  V4L/DVB (9333): cx88: Not all boards that requires cx88-mpeg has frontends
  V4L/DVB (9332): cx88: initial fix for analogue only compilation
  V4L/DVB (9331): Remove unused inode parameter from video_ioctl2
  V4L/DVB (9330): Get rid of inode parameter at v4l_compat_translate_ioctl()
  V4L/DVB (9328): ivtvfb: FB_BLANK_POWERDOWN turns off video output
  V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d
  V4L/DVB (9326): ivtv: avoid green flashing when loading ivtv
  V4L/DVB (9325): ivtv: switch to unlocked_ioctl.
  V4L/DVB (9324): v4l2: add video_ioctl2_unlocked for unlocked_ioctl support.
  V4L/DVB (9323): v4l2-int-if: Add enum_framesizes and enum_frameintervals ioctls.
  V4L/DVB (9322): v4l2-int-if: Export more interfaces to modules
  V4L/DVB (9321): v4l2-int-if: Define new power state changes
  V4L/DVB (9320): v4l2: Add 10-bit RAW Bayer formats
  V4L/DVB (9319): v4l2-int-if: Add cropcap, g_crop and s_crop commands.
  V4L/DVB (9318): v4l2-int-if: Add command to get slave private data.
  V4L/DVB (9316): s5h1411: Power down s5h1411 when not in use
  V4L/DVB (9315): s5h1411: Skip reconfiguring demod modulation if already at the desired modulation
  ...
Linus Torvalds 17 năm trước cách đây
mục cha
commit
296e1ce0dc
58 tập tin đã thay đổi với 495 bổ sung362 xóa
  1. 2 2
      drivers/media/common/saa7146_fops.c
  2. 9 3
      drivers/media/common/saa7146_video.c
  3. 58 26
      drivers/media/dvb/frontends/s5h1411.c
  4. 1 1
      drivers/media/dvb/frontends/s5h1411.h
  5. 37 25
      drivers/media/radio/dsbr100.c
  6. 5 0
      drivers/media/radio/radio-mr800.c
  7. 1 1
      drivers/media/video/arv.c
  8. 3 3
      drivers/media/video/bt8xx/bttv-driver.c
  9. 1 1
      drivers/media/video/c-qcam.c
  10. 2 2
      drivers/media/video/cafe_ccic.c
  11. 3 3
      drivers/media/video/cpia.c
  12. 1 1
      drivers/media/video/cpia2/cpia2_v4l.c
  13. 8 3
      drivers/media/video/cx18/cx18-driver.c
  14. 2 2
      drivers/media/video/cx18/cx18-io.h
  15. 22 14
      drivers/media/video/cx18/cx18-streams.c
  16. 1 1
      drivers/media/video/cx23885/cx23885-417.c
  17. 1 1
      drivers/media/video/cx23885/cx23885-video.c
  18. 1 1
      drivers/media/video/cx88/cx88-blackbird.c
  19. 2 2
      drivers/media/video/cx88/cx88-cards.c
  20. 5 6
      drivers/media/video/cx88/cx88-dvb.c
  21. 2 0
      drivers/media/video/cx88/cx88-i2c.c
  22. 8 7
      drivers/media/video/cx88/cx88-mpeg.c
  23. 3 3
      drivers/media/video/cx88/cx88-video.c
  24. 1 1
      drivers/media/video/em28xx/em28xx-video.c
  25. 12 12
      drivers/media/video/et61x251/et61x251_core.c
  26. 12 0
      drivers/media/video/ivtv/ivtv-driver.c
  27. 1 0
      drivers/media/video/ivtv/ivtv-i2c.c
  28. 6 7
      drivers/media/video/ivtv/ivtv-ioctl.c
  29. 1 2
      drivers/media/video/ivtv/ivtv-ioctl.h
  30. 2 2
      drivers/media/video/ivtv/ivtv-streams.c
  31. 6 0
      drivers/media/video/ivtv/ivtvfb.c
  32. 4 0
      drivers/media/video/pvrusb2/pvrusb2-encoder.c
  33. 0 6
      drivers/media/video/pvrusb2/pvrusb2-hdw.c
  34. 11 6
      drivers/media/video/pvrusb2/pvrusb2-v4l2.c
  35. 1 1
      drivers/media/video/pwc/pwc-if.c
  36. 3 3
      drivers/media/video/saa7134/saa7134-core.c
  37. 1 1
      drivers/media/video/saa7134/saa7134-empress.c
  38. 1 1
      drivers/media/video/se401.c
  39. 12 12
      drivers/media/video/sn9c102/sn9c102_core.c
  40. 2 2
      drivers/media/video/stk-webcam.c
  41. 2 1
      drivers/media/video/stv680.c
  42. 1 1
      drivers/media/video/usbvideo/usbvideo.c
  43. 2 1
      drivers/media/video/usbvideo/vicam.c
  44. 1 1
      drivers/media/video/usbvision/usbvision-i2c.c
  45. 6 6
      drivers/media/video/usbvision/usbvision-video.c
  46. 9 3
      drivers/media/video/uvc/uvc_v4l2.c
  47. 98 123
      drivers/media/video/v4l1-compat.c
  48. 4 1
      drivers/media/video/v4l2-int-device.c
  49. 13 6
      drivers/media/video/v4l2-ioctl.c
  50. 29 23
      drivers/media/video/videobuf-dvb.c
  51. 3 3
      drivers/media/video/vivi.c
  52. 8 8
      drivers/media/video/w9968cf.c
  53. 12 12
      drivers/media/video/zc0301/zc0301_core.c
  54. 1 1
      drivers/media/video/zr364xx.c
  55. 7 0
      include/linux/videodev2.h
  56. 26 2
      include/media/v4l2-int-device.h
  57. 18 6
      include/media/v4l2-ioctl.h
  58. 1 0
      include/media/videobuf-dvb.h

+ 2 - 2
drivers/media/common/saa7146_fops.c

@@ -545,11 +545,11 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
 	if( VFL_TYPE_GRABBER == type ) {
 	if( VFL_TYPE_GRABBER == type ) {
 		vv->video_minor = vfd->minor;
 		vv->video_minor = vfd->minor;
 		INFO(("%s: registered device video%d [v4l2]\n",
 		INFO(("%s: registered device video%d [v4l2]\n",
-			dev->name, vfd->minor & 0x1f));
+			dev->name, vfd->num));
 	} else {
 	} else {
 		vv->vbi_minor = vfd->minor;
 		vv->vbi_minor = vfd->minor;
 		INFO(("%s: registered device vbi%d [v4l2]\n",
 		INFO(("%s: registered device vbi%d [v4l2]\n",
-			dev->name, vfd->minor & 0x1f));
+			dev->name, vfd->num));
 	}
 	}
 
 
 	*vid = vfd;
 	*vid = vfd;

+ 9 - 3
drivers/media/common/saa7146_video.c

@@ -834,7 +834,7 @@ static int video_end(struct saa7146_fh *fh, struct file *file)
  * copying is done already, arg is a kernel pointer.
  * copying is done already, arg is a kernel pointer.
  */
  */
 
 
-int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int cmd, void *arg)
+static int __saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 {
 {
 	struct saa7146_fh *fh  = file->private_data;
 	struct saa7146_fh *fh  = file->private_data;
 	struct saa7146_dev *dev = fh->dev;
 	struct saa7146_dev *dev = fh->dev;
@@ -1215,12 +1215,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
 	}
 	}
 #endif
 #endif
 	default:
 	default:
-		return v4l_compat_translate_ioctl(inode,file,cmd,arg,
-						  saa7146_video_do_ioctl);
+		return v4l_compat_translate_ioctl(file, cmd, arg,
+						  __saa7146_video_do_ioctl);
 	}
 	}
 	return 0;
 	return 0;
 }
 }
 
 
+int saa7146_video_do_ioctl(struct inode *inode, struct file *file,
+				    unsigned int cmd, void *arg)
+{
+	return __saa7146_video_do_ioctl(file, cmd, arg);
+}
+
 /*********************************************************************************/
 /*********************************************************************************/
 /* buffer handling functions                                                  */
 /* buffer handling functions                                                  */
 
 

+ 58 - 26
drivers/media/dvb/frontends/s5h1411.c

@@ -38,6 +38,7 @@ struct s5h1411_state {
 	struct dvb_frontend frontend;
 	struct dvb_frontend frontend;
 
 
 	fe_modulation_t current_modulation;
 	fe_modulation_t current_modulation;
+	unsigned int first_tune:1;
 
 
 	u32 current_frequency;
 	u32 current_frequency;
 	int if_freq;
 	int if_freq;
@@ -62,7 +63,7 @@ static struct init_tab {
 	{ S5H1411_I2C_TOP_ADDR, 0x08, 0x0047, },
 	{ S5H1411_I2C_TOP_ADDR, 0x08, 0x0047, },
 	{ S5H1411_I2C_TOP_ADDR, 0x1c, 0x0400, },
 	{ S5H1411_I2C_TOP_ADDR, 0x1c, 0x0400, },
 	{ S5H1411_I2C_TOP_ADDR, 0x1e, 0x0370, },
 	{ S5H1411_I2C_TOP_ADDR, 0x1e, 0x0370, },
-	{ S5H1411_I2C_TOP_ADDR, 0x1f, 0x342a, },
+	{ S5H1411_I2C_TOP_ADDR, 0x1f, 0x342c, },
 	{ S5H1411_I2C_TOP_ADDR, 0x24, 0x0231, },
 	{ S5H1411_I2C_TOP_ADDR, 0x24, 0x0231, },
 	{ S5H1411_I2C_TOP_ADDR, 0x25, 0x1011, },
 	{ S5H1411_I2C_TOP_ADDR, 0x25, 0x1011, },
 	{ S5H1411_I2C_TOP_ADDR, 0x26, 0x0f07, },
 	{ S5H1411_I2C_TOP_ADDR, 0x26, 0x0f07, },
@@ -100,7 +101,6 @@ static struct init_tab {
 	{ S5H1411_I2C_TOP_ADDR, 0x78, 0x3141, },
 	{ S5H1411_I2C_TOP_ADDR, 0x78, 0x3141, },
 	{ S5H1411_I2C_TOP_ADDR, 0x7a, 0x3141, },
 	{ S5H1411_I2C_TOP_ADDR, 0x7a, 0x3141, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb3, 0x8003, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb3, 0x8003, },
-	{ S5H1411_I2C_TOP_ADDR, 0xb5, 0xafbb, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb5, 0xa6bb, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb5, 0xa6bb, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb6, 0x0609, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb6, 0x0609, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb7, 0x2f06, },
 	{ S5H1411_I2C_TOP_ADDR, 0xb7, 0x2f06, },
@@ -393,7 +393,7 @@ static int s5h1411_set_if_freq(struct dvb_frontend *fe, int KHz)
 
 
 	switch (KHz) {
 	switch (KHz) {
 	case 3250:
 	case 3250:
-		s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x38, 0x10d9);
+		s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x38, 0x10d5);
 		s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x39, 0x5342);
 		s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x39, 0x5342);
 		s5h1411_writereg(state, S5H1411_I2C_QAM_ADDR, 0x2c, 0x10d9);
 		s5h1411_writereg(state, S5H1411_I2C_QAM_ADDR, 0x2c, 0x10d9);
 		break;
 		break;
@@ -464,13 +464,25 @@ static int s5h1411_set_spectralinversion(struct dvb_frontend *fe, int inversion)
 
 
 	if (inversion == 1)
 	if (inversion == 1)
 		val |= 0x1000; /* Inverted */
 		val |= 0x1000; /* Inverted */
-	else
-		val |= 0x0000;
 
 
 	state->inversion = inversion;
 	state->inversion = inversion;
 	return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x24, val);
 	return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x24, val);
 }
 }
 
 
+static int s5h1411_set_serialmode(struct dvb_frontend *fe, int serial)
+{
+	struct s5h1411_state *state = fe->demodulator_priv;
+	u16 val;
+
+	dprintk("%s(%d)\n", __func__, serial);
+	val = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xbd) & ~0x100;
+
+	if (serial == 1)
+		val |= 0x100;
+
+	return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, val);
+}
+
 static int s5h1411_enable_modulation(struct dvb_frontend *fe,
 static int s5h1411_enable_modulation(struct dvb_frontend *fe,
 				     fe_modulation_t m)
 				     fe_modulation_t m)
 {
 {
@@ -478,6 +490,12 @@ static int s5h1411_enable_modulation(struct dvb_frontend *fe,
 
 
 	dprintk("%s(0x%08x)\n", __func__, m);
 	dprintk("%s(0x%08x)\n", __func__, m);
 
 
+	if ((state->first_tune == 0) && (m == state->current_modulation)) {
+		dprintk("%s() Already at desired modulation.  Skipping...\n",
+			__func__);
+		return 0;
+	}
+
 	switch (m) {
 	switch (m) {
 	case VSB_8:
 	case VSB_8:
 		dprintk("%s() VSB_8\n", __func__);
 		dprintk("%s() VSB_8\n", __func__);
@@ -502,6 +520,7 @@ static int s5h1411_enable_modulation(struct dvb_frontend *fe,
 	}
 	}
 
 
 	state->current_modulation = m;
 	state->current_modulation = m;
+	state->first_tune = 0;
 	s5h1411_softreset(fe);
 	s5h1411_softreset(fe);
 
 
 	return 0;
 	return 0;
@@ -535,7 +554,7 @@ static int s5h1411_set_gpio(struct dvb_frontend *fe, int enable)
 		return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xe0, val);
 		return s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xe0, val);
 }
 }
 
 
-static int s5h1411_sleep(struct dvb_frontend *fe, int enable)
+static int s5h1411_set_powerstate(struct dvb_frontend *fe, int enable)
 {
 {
 	struct s5h1411_state *state = fe->demodulator_priv;
 	struct s5h1411_state *state = fe->demodulator_priv;
 
 
@@ -551,6 +570,11 @@ static int s5h1411_sleep(struct dvb_frontend *fe, int enable)
 	return 0;
 	return 0;
 }
 }
 
 
+static int s5h1411_sleep(struct dvb_frontend *fe)
+{
+	return s5h1411_set_powerstate(fe, 1);
+}
+
 static int s5h1411_register_reset(struct dvb_frontend *fe)
 static int s5h1411_register_reset(struct dvb_frontend *fe)
 {
 {
 	struct s5h1411_state *state = fe->demodulator_priv;
 	struct s5h1411_state *state = fe->demodulator_priv;
@@ -574,9 +598,6 @@ static int s5h1411_set_frontend(struct dvb_frontend *fe,
 
 
 	s5h1411_enable_modulation(fe, p->u.vsb.modulation);
 	s5h1411_enable_modulation(fe, p->u.vsb.modulation);
 
 
-	/* Allow the demod to settle */
-	msleep(100);
-
 	if (fe->ops.tuner_ops.set_params) {
 	if (fe->ops.tuner_ops.set_params) {
 		if (fe->ops.i2c_gate_ctrl)
 		if (fe->ops.i2c_gate_ctrl)
 			fe->ops.i2c_gate_ctrl(fe, 1);
 			fe->ops.i2c_gate_ctrl(fe, 1);
@@ -587,6 +608,10 @@ static int s5h1411_set_frontend(struct dvb_frontend *fe,
 			fe->ops.i2c_gate_ctrl(fe, 0);
 			fe->ops.i2c_gate_ctrl(fe, 0);
 	}
 	}
 
 
+	/* Issue a reset to the demod so it knows to resync against the
+	   newly tuned frequency */
+	s5h1411_softreset(fe);
+
 	return 0;
 	return 0;
 }
 }
 
 
@@ -599,7 +624,7 @@ static int s5h1411_init(struct dvb_frontend *fe)
 
 
 	dprintk("%s()\n", __func__);
 	dprintk("%s()\n", __func__);
 
 
-	s5h1411_sleep(fe, 0);
+	s5h1411_set_powerstate(fe, 0);
 	s5h1411_register_reset(fe);
 	s5h1411_register_reset(fe);
 
 
 	for (i = 0; i < ARRAY_SIZE(init_tab); i++)
 	for (i = 0; i < ARRAY_SIZE(init_tab); i++)
@@ -610,12 +635,17 @@ static int s5h1411_init(struct dvb_frontend *fe)
 	/* The datasheet says that after initialisation, VSB is default */
 	/* The datasheet says that after initialisation, VSB is default */
 	state->current_modulation = VSB_8;
 	state->current_modulation = VSB_8;
 
 
+	/* Although the datasheet says it's in VSB, empirical evidence
+	   shows problems getting lock on the first tuning request.  Make
+	   sure we call enable_modulation the first time around */
+	state->first_tune = 1;
+
 	if (state->config->output_mode == S5H1411_SERIAL_OUTPUT)
 	if (state->config->output_mode == S5H1411_SERIAL_OUTPUT)
 		/* Serial */
 		/* Serial */
-		s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, 0x1101);
+		s5h1411_set_serialmode(fe, 1);
 	else
 	else
 		/* Parallel */
 		/* Parallel */
-		s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0xbd, 0x1001);
+		s5h1411_set_serialmode(fe, 0);
 
 
 	s5h1411_set_spectralinversion(fe, state->config->inversion);
 	s5h1411_set_spectralinversion(fe, state->config->inversion);
 	s5h1411_set_if_freq(fe, state->config->vsb_if);
 	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)
 
 
 	*status = 0;
 	*status = 0;
 
 
-	/* Get the demodulator status */
-	reg = (s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2) >> 15)
-		& 0x0001;
-	if (reg)
-		*status |= FE_HAS_LOCK | FE_HAS_CARRIER | FE_HAS_SIGNAL;
+	/* Register F2 bit 15 = Master Lock, removed */
 
 
 	switch (state->current_modulation) {
 	switch (state->current_modulation) {
 	case QAM_64:
 	case QAM_64:
 	case QAM_256:
 	case QAM_256:
 		reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf0);
 		reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf0);
-		if (reg & 0x100)
-			*status |= FE_HAS_VITERBI;
-		if (reg & 0x10)
-			*status |= FE_HAS_SYNC;
+		if (reg & 0x10) /* QAM FEC Lock */
+			*status |= FE_HAS_SYNC | FE_HAS_LOCK;
+		if (reg & 0x100) /* QAM EQ Lock */
+			*status |= FE_HAS_VITERBI | FE_HAS_CARRIER | FE_HAS_SIGNAL;
+
 		break;
 		break;
 	case VSB_8:
 	case VSB_8:
-		reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0x5e);
-		if (reg & 0x0001)
-			*status |= FE_HAS_SYNC;
 		reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2);
 		reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0xf2);
-		if (reg & 0x1000)
-			*status |= FE_HAS_VITERBI;
+		if (reg & 0x1000) /* FEC Lock */
+			*status |= FE_HAS_SYNC | FE_HAS_LOCK;
+		if (reg & 0x2000) /* EQ Lock */
+			*status |= FE_HAS_VITERBI | FE_HAS_CARRIER | FE_HAS_SIGNAL;
+
+		reg = s5h1411_readreg(state, S5H1411_I2C_TOP_ADDR, 0x53);
+		if (reg & 0x1) /* AFC Lock */
+			*status |= FE_HAS_SIGNAL;
+
 		break;
 		break;
 	default:
 	default:
 		return -EINVAL;
 		return -EINVAL;
@@ -863,6 +894,7 @@ static struct dvb_frontend_ops s5h1411_ops = {
 	},
 	},
 
 
 	.init                 = s5h1411_init,
 	.init                 = s5h1411_init,
+	.sleep                = s5h1411_sleep,
 	.i2c_gate_ctrl        = s5h1411_i2c_gate_ctrl,
 	.i2c_gate_ctrl        = s5h1411_i2c_gate_ctrl,
 	.set_frontend         = s5h1411_set_frontend,
 	.set_frontend         = s5h1411_set_frontend,
 	.get_frontend         = s5h1411_get_frontend,
 	.get_frontend         = s5h1411_get_frontend,

+ 1 - 1
drivers/media/dvb/frontends/s5h1411.h

@@ -47,7 +47,7 @@ struct s5h1411_config {
 	u16 mpeg_timing;
 	u16 mpeg_timing;
 
 
 	/* IF Freq for QAM and VSB in KHz */
 	/* IF Freq for QAM and VSB in KHz */
-#define S5H1411_IF_2500  2500
+#define S5H1411_IF_3250  3250
 #define S5H1411_IF_3500  3500
 #define S5H1411_IF_3500  3500
 #define S5H1411_IF_4000  4000
 #define S5H1411_IF_4000  4000
 #define S5H1411_IF_5380  5380
 #define S5H1411_IF_5380  5380

+ 37 - 25
drivers/media/radio/dsbr100.c

@@ -171,11 +171,11 @@ static int dsbr100_start(struct dsbr100_device *radio)
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 			USB_REQ_GET_STATUS,
 			USB_REQ_GET_STATUS,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-			0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 ||
+			0x00, 0xC7, radio->transfer_buffer, 8, 300) < 0 ||
 	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 			DSB100_ONOFF,
 			DSB100_ONOFF,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-			0x01, 0x00, radio->transfer_buffer, 8, 300)<0)
+			0x01, 0x00, radio->transfer_buffer, 8, 300) < 0)
 		return -1;
 		return -1;
 	radio->muted=0;
 	radio->muted=0;
 	return (radio->transfer_buffer)[0];
 	return (radio->transfer_buffer)[0];
@@ -188,11 +188,11 @@ static int dsbr100_stop(struct dsbr100_device *radio)
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 			USB_REQ_GET_STATUS,
 			USB_REQ_GET_STATUS,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-			0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 ||
+			0x16, 0x1C, radio->transfer_buffer, 8, 300) < 0 ||
 	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 			DSB100_ONOFF,
 			DSB100_ONOFF,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-			0x00, 0x00, radio->transfer_buffer, 8, 300)<0)
+			0x00, 0x00, radio->transfer_buffer, 8, 300) < 0)
 		return -1;
 		return -1;
 	radio->muted=1;
 	radio->muted=1;
 	return (radio->transfer_buffer)[0];
 	return (radio->transfer_buffer)[0];
@@ -201,24 +201,24 @@ static int dsbr100_stop(struct dsbr100_device *radio)
 /* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
 /* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
 static int dsbr100_setfreq(struct dsbr100_device *radio, int freq)
 static int dsbr100_setfreq(struct dsbr100_device *radio, int freq)
 {
 {
-	freq = (freq/16*80)/1000+856;
+	freq = (freq / 16 * 80) / 1000 + 856;
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 			DSB100_TUNE,
 			DSB100_TUNE,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-			(freq>>8)&0x00ff, freq&0xff,
-			radio->transfer_buffer, 8, 300)<0 ||
+			(freq >> 8) & 0x00ff, freq & 0xff,
+			radio->transfer_buffer, 8, 300) < 0 ||
 	   usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	   usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 			USB_REQ_GET_STATUS,
 			USB_REQ_GET_STATUS,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-			0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 ||
+			0x96, 0xB7, radio->transfer_buffer, 8, 300) < 0 ||
 	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 			USB_REQ_GET_STATUS,
 			USB_REQ_GET_STATUS,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE |  USB_DIR_IN,
 			USB_TYPE_VENDOR | USB_RECIP_DEVICE |  USB_DIR_IN,
-			0x00, 0x24, radio->transfer_buffer, 8, 300)<0) {
+			0x00, 0x24, radio->transfer_buffer, 8, 300) < 0) {
 		radio->stereo = -1;
 		radio->stereo = -1;
 		return -1;
 		return -1;
 	}
 	}
-	radio->stereo = ! ((radio->transfer_buffer)[0]&0x01);
+	radio->stereo = !((radio->transfer_buffer)[0] & 0x01);
 	return (radio->transfer_buffer)[0];
 	return (radio->transfer_buffer)[0];
 }
 }
 
 
@@ -229,10 +229,10 @@ static void dsbr100_getstat(struct dsbr100_device *radio)
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 	if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0),
 		USB_REQ_GET_STATUS,
 		USB_REQ_GET_STATUS,
 		USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
 		USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
-		0x00 , 0x24, radio->transfer_buffer, 8, 300)<0)
+		0x00 , 0x24, radio->transfer_buffer, 8, 300) < 0)
 		radio->stereo = -1;
 		radio->stereo = -1;
 	else
 	else
-		radio->stereo = ! (radio->transfer_buffer[0]&0x01);
+		radio->stereo = !(radio->transfer_buffer[0] & 0x01);
 }
 }
 
 
 
 
@@ -265,7 +265,7 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
 {
 	strlcpy(v->driver, "dsbr100", sizeof(v->driver));
 	strlcpy(v->driver, "dsbr100", sizeof(v->driver));
 	strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card));
 	strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card));
-	sprintf(v->bus_info, "ISA");
+	sprintf(v->bus_info, "USB");
 	v->version = RADIO_VERSION;
 	v->version = RADIO_VERSION;
 	v->capabilities = V4L2_CAP_TUNER;
 	v->capabilities = V4L2_CAP_TUNER;
 	return 0;
 	return 0;
@@ -282,9 +282,9 @@ static int vidioc_g_tuner(struct file *file, void *priv,
 	dsbr100_getstat(radio);
 	dsbr100_getstat(radio);
 	strcpy(v->name, "FM");
 	strcpy(v->name, "FM");
 	v->type = V4L2_TUNER_RADIO;
 	v->type = V4L2_TUNER_RADIO;
-	v->rangelow = FREQ_MIN*FREQ_MUL;
-	v->rangehigh = FREQ_MAX*FREQ_MUL;
-	v->rxsubchans = V4L2_TUNER_SUB_MONO|V4L2_TUNER_SUB_STEREO;
+	v->rangelow = FREQ_MIN * FREQ_MUL;
+	v->rangehigh = FREQ_MAX * FREQ_MUL;
+	v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
 	v->capability = V4L2_TUNER_CAP_LOW;
 	v->capability = V4L2_TUNER_CAP_LOW;
 	if(radio->stereo)
 	if(radio->stereo)
 		v->audmode = V4L2_TUNER_MODE_STEREO;
 		v->audmode = V4L2_TUNER_MODE_STEREO;
@@ -309,7 +309,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
 	struct dsbr100_device *radio = video_drvdata(file);
 	struct dsbr100_device *radio = video_drvdata(file);
 
 
 	radio->curfreq = f->frequency;
 	radio->curfreq = f->frequency;
-	if (dsbr100_setfreq(radio, radio->curfreq)==-1)
+	if (dsbr100_setfreq(radio, radio->curfreq) == -1)
 		dev_warn(&radio->usbdev->dev, "Set frequency failed\n");
 		dev_warn(&radio->usbdev->dev, "Set frequency failed\n");
 	return 0;
 	return 0;
 }
 }
@@ -331,8 +331,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
 
 
 	for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
 	for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
 		if (qc->id && qc->id == radio_qctrl[i].id) {
 		if (qc->id && qc->id == radio_qctrl[i].id) {
-			memcpy(qc, &(radio_qctrl[i]),
-						sizeof(*qc));
+			memcpy(qc, &(radio_qctrl[i]), sizeof(*qc));
 			return 0;
 			return 0;
 		}
 		}
 	}
 	}
@@ -412,19 +411,25 @@ static int vidioc_s_audio(struct file *file, void *priv,
 static int usb_dsbr100_open(struct inode *inode, struct file *file)
 static int usb_dsbr100_open(struct inode *inode, struct file *file)
 {
 {
 	struct dsbr100_device *radio = video_drvdata(file);
 	struct dsbr100_device *radio = video_drvdata(file);
+	int retval;
 
 
 	lock_kernel();
 	lock_kernel();
 	radio->users = 1;
 	radio->users = 1;
 	radio->muted = 1;
 	radio->muted = 1;
 
 
-	if (dsbr100_start(radio)<0) {
+	if (dsbr100_start(radio) < 0) {
 		dev_warn(&radio->usbdev->dev,
 		dev_warn(&radio->usbdev->dev,
 			 "Radio did not start up properly\n");
 			 "Radio did not start up properly\n");
 		radio->users = 0;
 		radio->users = 0;
 		unlock_kernel();
 		unlock_kernel();
 		return -EIO;
 		return -EIO;
 	}
 	}
-	dsbr100_setfreq(radio, radio->curfreq);
+
+	retval = dsbr100_setfreq(radio, radio->curfreq);
+
+	if (retval == -1)
+		printk(KERN_WARNING KBUILD_MODNAME ": Set frequency failed\n");
+
 	unlock_kernel();
 	unlock_kernel();
 	return 0;
 	return 0;
 }
 }
@@ -485,13 +490,20 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
 {
 {
 	struct dsbr100_device *radio;
 	struct dsbr100_device *radio;
 
 
-	if (!(radio = kmalloc(sizeof(struct dsbr100_device), GFP_KERNEL)))
+	radio = kmalloc(sizeof(struct dsbr100_device), GFP_KERNEL);
+
+	if (!radio)
 		return -ENOMEM;
 		return -ENOMEM;
-	if (!(radio->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL))) {
+
+	radio->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL);
+
+	if (!(radio->transfer_buffer)) {
 		kfree(radio);
 		kfree(radio);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
-	if (!(radio->videodev = video_device_alloc())) {
+	radio->videodev = video_device_alloc();
+
+	if (!(radio->videodev)) {
 		kfree(radio->transfer_buffer);
 		kfree(radio->transfer_buffer);
 		kfree(radio);
 		kfree(radio);
 		return -ENOMEM;
 		return -ENOMEM;
@@ -501,7 +513,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
 	radio->removed = 0;
 	radio->removed = 0;
 	radio->users = 0;
 	radio->users = 0;
 	radio->usbdev = interface_to_usbdev(intf);
 	radio->usbdev = interface_to_usbdev(intf);
-	radio->curfreq = FREQ_MIN*FREQ_MUL;
+	radio->curfreq = FREQ_MIN * FREQ_MUL;
 	video_set_drvdata(radio->videodev, radio);
 	video_set_drvdata(radio->videodev, radio);
 	if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) {
 	if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) {
 		dev_warn(&intf->dev, "Could not register video device\n");
 		dev_warn(&intf->dev, "Could not register video device\n");

+ 5 - 0
drivers/media/radio/radio-mr800.c

@@ -469,16 +469,21 @@ static int usb_amradio_open(struct inode *inode, struct file *file)
 {
 {
 	struct amradio_device *radio = video_get_drvdata(video_devdata(file));
 	struct amradio_device *radio = video_get_drvdata(video_devdata(file));
 
 
+	lock_kernel();
+
 	radio->users = 1;
 	radio->users = 1;
 	radio->muted = 1;
 	radio->muted = 1;
 
 
 	if (amradio_start(radio) < 0) {
 	if (amradio_start(radio) < 0) {
 		warn("Radio did not start up properly");
 		warn("Radio did not start up properly");
 		radio->users = 0;
 		radio->users = 0;
+		unlock_kernel();
 		return -EIO;
 		return -EIO;
 	}
 	}
 	if (amradio_setfreq(radio, radio->curfreq) < 0)
 	if (amradio_setfreq(radio, radio->curfreq) < 0)
 		warn("Set frequency failed");
 		warn("Set frequency failed");
+
+	unlock_kernel();
 	return 0;
 	return 0;
 }
 }
 
 

+ 1 - 1
drivers/media/video/arv.c

@@ -866,7 +866,7 @@ static int __init ar_init(void)
 	}
 	}
 
 
 	printk("video%d: Found M64278 VGA (IRQ %d, Freq %dMHz).\n",
 	printk("video%d: Found M64278 VGA (IRQ %d, Freq %dMHz).\n",
-		ar->vdev->minor, M32R_IRQ_INT3, freq);
+		ar->vdev->num, M32R_IRQ_INT3, freq);
 
 
 	return 0;
 	return 0;
 
 

+ 3 - 3
drivers/media/video/bt8xx/bttv-driver.c

@@ -4246,7 +4246,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
 				  video_nr[btv->c.nr]) < 0)
 				  video_nr[btv->c.nr]) < 0)
 		goto err;
 		goto err;
 	printk(KERN_INFO "bttv%d: registered device video%d\n",
 	printk(KERN_INFO "bttv%d: registered device video%d\n",
-	       btv->c.nr,btv->video_dev->minor & 0x1f);
+	       btv->c.nr, btv->video_dev->num);
 	if (device_create_file(&btv->video_dev->dev,
 	if (device_create_file(&btv->video_dev->dev,
 				     &dev_attr_card)<0) {
 				     &dev_attr_card)<0) {
 		printk(KERN_ERR "bttv%d: device_create_file 'card' "
 		printk(KERN_ERR "bttv%d: device_create_file 'card' "
@@ -4263,7 +4263,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
 				  vbi_nr[btv->c.nr]) < 0)
 				  vbi_nr[btv->c.nr]) < 0)
 		goto err;
 		goto err;
 	printk(KERN_INFO "bttv%d: registered device vbi%d\n",
 	printk(KERN_INFO "bttv%d: registered device vbi%d\n",
-	       btv->c.nr,btv->vbi_dev->minor & 0x1f);
+	       btv->c.nr, btv->vbi_dev->num);
 
 
 	if (!btv->has_radio)
 	if (!btv->has_radio)
 		return 0;
 		return 0;
@@ -4275,7 +4275,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
 				  radio_nr[btv->c.nr]) < 0)
 				  radio_nr[btv->c.nr]) < 0)
 		goto err;
 		goto err;
 	printk(KERN_INFO "bttv%d: registered device radio%d\n",
 	printk(KERN_INFO "bttv%d: registered device radio%d\n",
-	       btv->c.nr,btv->radio_dev->minor & 0x1f);
+	       btv->c.nr, btv->radio_dev->num);
 
 
 	/* all done */
 	/* all done */
 	return 0;
 	return 0;

+ 1 - 1
drivers/media/video/c-qcam.c

@@ -815,7 +815,7 @@ static int init_cqcam(struct parport *port)
 	}
 	}
 
 
 	printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
 	printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
-	       qcam->vdev.minor, qcam->pport->name);
+	       qcam->vdev.num, qcam->pport->name);
 
 
 	qcams[num_cams++] = qcam;
 	qcams[num_cams++] = qcam;
 
 

+ 2 - 2
drivers/media/video/cafe_ccic.c

@@ -2059,10 +2059,10 @@ static void cafe_dfs_cam_setup(struct cafe_camera *cam)
 
 
 	if (!cafe_dfs_root)
 	if (!cafe_dfs_root)
 		return;
 		return;
-	sprintf(fname, "regs-%d", cam->v4ldev.minor);
+	sprintf(fname, "regs-%d", cam->v4ldev.num);
 	cam->dfs_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
 	cam->dfs_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
 			cam, &cafe_dfs_reg_ops);
 			cam, &cafe_dfs_reg_ops);
-	sprintf(fname, "cam-%d", cam->v4ldev.minor);
+	sprintf(fname, "cam-%d", cam->v4ldev.num);
 	cam->dfs_cam_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
 	cam->dfs_cam_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
 			cam, &cafe_dfs_cam_ops);
 			cam, &cafe_dfs_cam_ops);
 }
 }

+ 3 - 3
drivers/media/video/cpia.c

@@ -1347,7 +1347,7 @@ static void create_proc_cpia_cam(struct cam_data *cam)
 	if (!cpia_proc_root || !cam)
 	if (!cpia_proc_root || !cam)
 		return;
 		return;
 
 
-	snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
+	snprintf(name, sizeof(name), "video%d", cam->vdev.num);
 
 
 	ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
 	ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
 	if (!ent)
 	if (!ent)
@@ -1372,7 +1372,7 @@ static void destroy_proc_cpia_cam(struct cam_data *cam)
 	if (!cam || !cam->proc_entry)
 	if (!cam || !cam->proc_entry)
 		return;
 		return;
 
 
-	snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
+	snprintf(name, sizeof(name), "video%d", cam->vdev.num);
 	remove_proc_entry(name, cpia_proc_root);
 	remove_proc_entry(name, cpia_proc_root);
 	cam->proc_entry = NULL;
 	cam->proc_entry = NULL;
 }
 }
@@ -4005,7 +4005,7 @@ void cpia_unregister_camera(struct cam_data *cam)
 	}
 	}
 
 
 #ifdef CONFIG_PROC_FS
 #ifdef CONFIG_PROC_FS
-	DBG("destroying /proc/cpia/video%d\n", cam->vdev.minor);
+	DBG("destroying /proc/cpia/video%d\n", cam->vdev.num);
 	destroy_proc_cpia_cam(cam);
 	destroy_proc_cpia_cam(cam);
 #endif
 #endif
 	if (!cam->open_count) {
 	if (!cam->open_count) {

+ 1 - 1
drivers/media/video/cpia2/cpia2_v4l.c

@@ -1973,7 +1973,7 @@ void cpia2_unregister_camera(struct camera_data *cam)
 	} else {
 	} else {
 		LOG("/dev/video%d removed while open, "
 		LOG("/dev/video%d removed while open, "
 		    "deferring video_unregister_device\n",
 		    "deferring video_unregister_device\n",
-		    cam->vdev->minor);
+		    cam->vdev->num);
 	}
 	}
 }
 }
 
 

+ 8 - 3
drivers/media/video/cx18/cx18-driver.c

@@ -613,6 +613,7 @@ static int __devinit cx18_probe(struct pci_dev *dev,
 				const struct pci_device_id *pci_id)
 				const struct pci_device_id *pci_id)
 {
 {
 	int retval = 0;
 	int retval = 0;
+	int i;
 	int vbi_buf_size;
 	int vbi_buf_size;
 	u32 devtype;
 	u32 devtype;
 	struct cx18 *cx;
 	struct cx18 *cx;
@@ -698,7 +699,8 @@ static int __devinit cx18_probe(struct pci_dev *dev,
 
 
 	/* active i2c  */
 	/* active i2c  */
 	CX18_DEBUG_INFO("activating i2c...\n");
 	CX18_DEBUG_INFO("activating i2c...\n");
-	if (init_cx18_i2c(cx)) {
+	retval = init_cx18_i2c(cx);
+	if (retval) {
 		CX18_ERR("Could not initialize i2c\n");
 		CX18_ERR("Could not initialize i2c\n");
 		goto free_map;
 		goto free_map;
 	}
 	}
@@ -836,8 +838,11 @@ err:
 	CX18_ERR("Error %d on initialization\n", retval);
 	CX18_ERR("Error %d on initialization\n", retval);
 	cx18_log_statistics(cx);
 	cx18_log_statistics(cx);
 
 
-	kfree(cx18_cards[cx18_cards_active]);
-	cx18_cards[cx18_cards_active] = NULL;
+	i = cx->num;
+	spin_lock(&cx18_cards_lock);
+	kfree(cx18_cards[i]);
+	cx18_cards[i] = NULL;
+	spin_unlock(&cx18_cards_lock);
 	return retval;
 	return retval;
 }
 }
 
 

+ 2 - 2
drivers/media/video/cx18/cx18-io.h

@@ -39,7 +39,7 @@ static inline void cx18_io_delay(struct cx18 *cx)
 
 
 /* Statistics gathering */
 /* Statistics gathering */
 static inline
 static inline
-void cx18_log_write_retries(struct cx18 *cx, int i, const void *addr)
+void cx18_log_write_retries(struct cx18 *cx, int i, const void __iomem *addr)
 {
 {
 	if (i > CX18_MAX_MMIO_RETRIES)
 	if (i > CX18_MAX_MMIO_RETRIES)
 		i = CX18_MAX_MMIO_RETRIES;
 		i = CX18_MAX_MMIO_RETRIES;
@@ -48,7 +48,7 @@ void cx18_log_write_retries(struct cx18 *cx, int i, const void *addr)
 }
 }
 
 
 static inline
 static inline
-void cx18_log_read_retries(struct cx18 *cx, int i, const void *addr)
+void cx18_log_read_retries(struct cx18 *cx, int i, const void __iomem *addr)
 {
 {
 	if (i > CX18_MAX_MMIO_RETRIES)
 	if (i > CX18_MAX_MMIO_RETRIES)
 		i = CX18_MAX_MMIO_RETRIES;
 		i = CX18_MAX_MMIO_RETRIES;

+ 22 - 14
drivers/media/video/cx18/cx18-streams.c

@@ -200,16 +200,18 @@ static int cx18_prep_dev(struct cx18 *cx, int type)
 /* Initialize v4l2 variables and register v4l2 devices */
 /* Initialize v4l2 variables and register v4l2 devices */
 int cx18_streams_setup(struct cx18 *cx)
 int cx18_streams_setup(struct cx18 *cx)
 {
 {
-	int type;
+	int type, ret;
 
 
 	/* Setup V4L2 Devices */
 	/* Setup V4L2 Devices */
 	for (type = 0; type < CX18_MAX_STREAMS; type++) {
 	for (type = 0; type < CX18_MAX_STREAMS; type++) {
 		/* Prepare device */
 		/* Prepare device */
-		if (cx18_prep_dev(cx, type))
+		ret = cx18_prep_dev(cx, type);
+		if (ret < 0)
 			break;
 			break;
 
 
 		/* Allocate Stream */
 		/* Allocate Stream */
-		if (cx18_stream_alloc(&cx->streams[type]))
+		ret = cx18_stream_alloc(&cx->streams[type]);
+		if (ret < 0)
 			break;
 			break;
 	}
 	}
 	if (type == CX18_MAX_STREAMS)
 	if (type == CX18_MAX_STREAMS)
@@ -217,14 +219,14 @@ int cx18_streams_setup(struct cx18 *cx)
 
 
 	/* One or more streams could not be initialized. Clean 'em all up. */
 	/* One or more streams could not be initialized. Clean 'em all up. */
 	cx18_streams_cleanup(cx, 0);
 	cx18_streams_cleanup(cx, 0);
-	return -ENOMEM;
+	return ret;
 }
 }
 
 
 static int cx18_reg_dev(struct cx18 *cx, int type)
 static int cx18_reg_dev(struct cx18 *cx, int type)
 {
 {
 	struct cx18_stream *s = &cx->streams[type];
 	struct cx18_stream *s = &cx->streams[type];
 	int vfl_type = cx18_stream_info[type].vfl_type;
 	int vfl_type = cx18_stream_info[type].vfl_type;
-	int num;
+	int num, ret;
 
 
 	/* TODO: Shouldn't this be a VFL_TYPE_TRANSPORT or something?
 	/* TODO: Shouldn't this be a VFL_TYPE_TRANSPORT or something?
 	 * We need a VFL_TYPE_TS defined.
 	 * We need a VFL_TYPE_TS defined.
@@ -233,9 +235,10 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
 		/* just return if no DVB is supported */
 		/* just return if no DVB is supported */
 		if ((cx->card->hw_all & CX18_HW_DVB) == 0)
 		if ((cx->card->hw_all & CX18_HW_DVB) == 0)
 			return 0;
 			return 0;
-		if (cx18_dvb_register(s) < 0) {
+		ret = cx18_dvb_register(s);
+		if (ret < 0) {
 			CX18_ERR("DVB failed to register\n");
 			CX18_ERR("DVB failed to register\n");
-			return -EINVAL;
+			return ret;
 		}
 		}
 	}
 	}
 
 
@@ -252,12 +255,13 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
 	}
 	}
 
 
 	/* Register device. First try the desired minor, then any free one. */
 	/* Register device. First try the desired minor, then any free one. */
-	if (video_register_device(s->v4l2dev, vfl_type, num)) {
+	ret = video_register_device(s->v4l2dev, vfl_type, num);
+	if (ret < 0) {
 		CX18_ERR("Couldn't register v4l2 device for %s kernel number %d\n",
 		CX18_ERR("Couldn't register v4l2 device for %s kernel number %d\n",
 			s->name, num);
 			s->name, num);
 		video_device_release(s->v4l2dev);
 		video_device_release(s->v4l2dev);
 		s->v4l2dev = NULL;
 		s->v4l2dev = NULL;
-		return -ENOMEM;
+		return ret;
 	}
 	}
 	num = s->v4l2dev->num;
 	num = s->v4l2dev->num;
 
 
@@ -290,18 +294,22 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
 int cx18_streams_register(struct cx18 *cx)
 int cx18_streams_register(struct cx18 *cx)
 {
 {
 	int type;
 	int type;
-	int err = 0;
+	int err;
+	int ret = 0;
 
 
 	/* Register V4L2 devices */
 	/* Register V4L2 devices */
-	for (type = 0; type < CX18_MAX_STREAMS; type++)
-		err |= cx18_reg_dev(cx, type);
+	for (type = 0; type < CX18_MAX_STREAMS; type++) {
+		err = cx18_reg_dev(cx, type);
+		if (err && ret == 0)
+			ret = err;
+	}
 
 
-	if (err == 0)
+	if (ret == 0)
 		return 0;
 		return 0;
 
 
 	/* One or more streams could not be initialized. Clean 'em all up. */
 	/* One or more streams could not be initialized. Clean 'em all up. */
 	cx18_streams_cleanup(cx, 1);
 	cx18_streams_cleanup(cx, 1);
-	return -ENOMEM;
+	return ret;
 }
 }
 
 
 /* Unregister v4l2 devices */
 /* Unregister v4l2 devices */

+ 1 - 1
drivers/media/video/cx23885/cx23885-417.c

@@ -1815,7 +1815,7 @@ int cx23885_417_register(struct cx23885_dev *dev)
 	cx23885_mc417_init(dev);
 	cx23885_mc417_init(dev);
 
 
 	printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
 	printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
-	       dev->name, dev->v4l_device->minor & 0x1f);
+	       dev->name, dev->v4l_device->num);
 
 
 	return 0;
 	return 0;
 }
 }

+ 1 - 1
drivers/media/video/cx23885/cx23885-video.c

@@ -1543,7 +1543,7 @@ int cx23885_video_register(struct cx23885_dev *dev)
 		goto fail_unreg;
 		goto fail_unreg;
 	}
 	}
 	printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
 	printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
-	       dev->name, dev->video_dev->minor & 0x1f);
+	       dev->name, dev->video_dev->num);
 	/* initial device configuration */
 	/* initial device configuration */
 	mutex_lock(&dev->lock);
 	mutex_lock(&dev->lock);
 	cx23885_set_tvnorm(dev, dev->tvnorm);
 	cx23885_set_tvnorm(dev, dev->tvnorm);

+ 1 - 1
drivers/media/video/cx88/cx88-blackbird.c

@@ -1285,7 +1285,7 @@ static int blackbird_register_video(struct cx8802_dev *dev)
 		return err;
 		return err;
 	}
 	}
 	printk(KERN_INFO "%s/2: registered device video%d [mpeg]\n",
 	printk(KERN_INFO "%s/2: registered device video%d [mpeg]\n",
-	       dev->core->name,dev->mpeg_dev->minor & 0x1f);
+	       dev->core->name, dev->mpeg_dev->num);
 	return 0;
 	return 0;
 }
 }
 
 

+ 2 - 2
drivers/media/video/cx88/cx88-cards.c

@@ -3044,8 +3044,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
 
 
 	memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
 	memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
 
 
-	if (!core->board.num_frontends)
-		core->board.num_frontends=1;
+	if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB))
+		core->board.num_frontends = 1;
 
 
 	info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n",
 	info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n",
 		pci->subsystem_vendor, pci->subsystem_device, core->board.name,
 		pci->subsystem_vendor, pci->subsystem_device, core->board.name,

+ 5 - 6
drivers/media/video/cx88/cx88-dvb.c

@@ -789,7 +789,7 @@ static int dvb_register(struct cx8802_dev *dev)
 		if (fe0->dvb.frontend)
 		if (fe0->dvb.frontend)
 			fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
 			fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
 		if (attach_xc3028(0x61, dev) < 0)
 		if (attach_xc3028(0x61, dev) < 0)
-			return -EINVAL;
+			goto frontend_detach;
 		break;
 		break;
 	case CX88_BOARD_PCHDTV_HD3000:
 	case CX88_BOARD_PCHDTV_HD3000:
 		fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000,
 		fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000,
@@ -1058,7 +1058,6 @@ static int dvb_register(struct cx8802_dev *dev)
 					goto frontend_detach;
 					goto frontend_detach;
 				core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
 				core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
 				fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
 				fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
-
 			}
 			}
 		}
 		}
 		break;
 		break;
@@ -1110,10 +1109,7 @@ static int dvb_register(struct cx8802_dev *dev)
 		&dev->pci->dev, adapter_nr, mfe_shared);
 		&dev->pci->dev, adapter_nr, mfe_shared);
 
 
 frontend_detach:
 frontend_detach:
-	if (fe0->dvb.frontend) {
-		dvb_frontend_detach(fe0->dvb.frontend);
-		fe0->dvb.frontend = NULL;
-	}
+	videobuf_dvb_dealloc_frontends(&dev->frontends);
 	return -EINVAL;
 	return -EINVAL;
 }
 }
 
 
@@ -1246,8 +1242,11 @@ fail_core:
 
 
 static int cx8802_dvb_remove(struct cx8802_driver *drv)
 static int cx8802_dvb_remove(struct cx8802_driver *drv)
 {
 {
+	struct cx88_core *core = drv->core;
 	struct cx8802_dev *dev = drv->core->dvbdev;
 	struct cx8802_dev *dev = drv->core->dvbdev;
 
 
+	dprintk( 1, "%s\n", __func__);
+
 	videobuf_dvb_unregister_bus(&dev->frontends);
 	videobuf_dvb_unregister_bus(&dev->frontends);
 
 
 	vp3054_i2c_remove(dev);
 	vp3054_i2c_remove(dev);

+ 2 - 0
drivers/media/video/cx88/cx88-i2c.c

@@ -116,8 +116,10 @@ static int detach_inform(struct i2c_client *client)
 
 
 void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
 void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
 {
 {
+#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
 	struct videobuf_dvb_frontends *f = &core->dvbdev->frontends;
 	struct videobuf_dvb_frontends *f = &core->dvbdev->frontends;
 	struct videobuf_dvb_frontend *fe = NULL;
 	struct videobuf_dvb_frontend *fe = NULL;
+#endif
 	if (0 != core->i2c_rc)
 	if (0 != core->i2c_rc)
 		return;
 		return;
 
 

+ 8 - 7
drivers/media/video/cx88/cx88-mpeg.c

@@ -768,8 +768,11 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
 {
 {
 	struct cx8802_dev *dev;
 	struct cx8802_dev *dev;
 	struct cx88_core  *core;
 	struct cx88_core  *core;
+	int err;
+#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
 	struct videobuf_dvb_frontend *demod;
 	struct videobuf_dvb_frontend *demod;
-	int err,i;
+	int i;
+#endif
 
 
 	/* general setup */
 	/* general setup */
 	core = cx88_core_get(pci_dev);
 	core = cx88_core_get(pci_dev);
@@ -782,11 +785,6 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
 	if (!core->board.mpeg)
 	if (!core->board.mpeg)
 		goto fail_core;
 		goto fail_core;
 
 
-	if (!core->board.num_frontends) {
-		printk(KERN_ERR "%s() .num_frontends should be non-zero, err = %d\n", __func__, err);
-		goto fail_core;
-	}
-
 	err = -ENOMEM;
 	err = -ENOMEM;
 	dev = kzalloc(sizeof(*dev),GFP_KERNEL);
 	dev = kzalloc(sizeof(*dev),GFP_KERNEL);
 	if (NULL == dev)
 	if (NULL == dev)
@@ -801,10 +799,12 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
 	INIT_LIST_HEAD(&dev->drvlist);
 	INIT_LIST_HEAD(&dev->drvlist);
 	list_add_tail(&dev->devlist,&cx8802_devlist);
 	list_add_tail(&dev->devlist,&cx8802_devlist);
 
 
+#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
 	mutex_init(&dev->frontends.lock);
 	mutex_init(&dev->frontends.lock);
 	INIT_LIST_HEAD(&dev->frontends.felist);
 	INIT_LIST_HEAD(&dev->frontends.felist);
 
 
-	printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends);
+	if (core->board.num_frontends)
+		printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, core->board.num_frontends);
 
 
 	for (i = 1; i <= core->board.num_frontends; i++) {
 	for (i = 1; i <= core->board.num_frontends; i++) {
 		demod = videobuf_dvb_alloc_frontend(&dev->frontends, i);
 		demod = videobuf_dvb_alloc_frontend(&dev->frontends, i);
@@ -814,6 +814,7 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
 			goto fail_free;
 			goto fail_free;
 		}
 		}
 	}
 	}
+#endif
 
 
 	/* Maintain a reference so cx88-video can query the 8802 device. */
 	/* Maintain a reference so cx88-video can query the 8802 device. */
 	core->dvbdev = dev;
 	core->dvbdev = dev;

+ 3 - 3
drivers/media/video/cx88/cx88-video.c

@@ -1911,7 +1911,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 		goto fail_unreg;
 		goto fail_unreg;
 	}
 	}
 	printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
 	printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
-	       core->name,dev->video_dev->minor & 0x1f);
+	       core->name, dev->video_dev->num);
 
 
 	dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi");
 	dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi");
 	err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
 	err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
@@ -1922,7 +1922,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 		goto fail_unreg;
 		goto fail_unreg;
 	}
 	}
 	printk(KERN_INFO "%s/0: registered device vbi%d\n",
 	printk(KERN_INFO "%s/0: registered device vbi%d\n",
-	       core->name,dev->vbi_dev->minor & 0x1f);
+	       core->name, dev->vbi_dev->num);
 
 
 	if (core->board.radio.type == CX88_RADIO) {
 	if (core->board.radio.type == CX88_RADIO) {
 		dev->radio_dev = cx88_vdev_init(core,dev->pci,
 		dev->radio_dev = cx88_vdev_init(core,dev->pci,
@@ -1935,7 +1935,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 			goto fail_unreg;
 			goto fail_unreg;
 		}
 		}
 		printk(KERN_INFO "%s/0: registered device radio%d\n",
 		printk(KERN_INFO "%s/0: registered device radio%d\n",
-		       core->name,dev->radio_dev->minor & 0x1f);
+		       core->name, dev->radio_dev->num);
 	}
 	}
 
 
 	/* everything worked */
 	/* everything worked */

+ 1 - 1
drivers/media/video/em28xx/em28xx-video.c

@@ -2042,7 +2042,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
 			goto fail_unreg;
 			goto fail_unreg;
 		}
 		}
 		em28xx_info("Registered radio device as /dev/radio%d\n",
 		em28xx_info("Registered radio device as /dev/radio%d\n",
-			    dev->radio_dev->minor & 0x1f);
+			    dev->radio_dev->num);
 	}
 	}
 
 
 	/* init video dma queues */
 	/* init video dma queues */

+ 12 - 12
drivers/media/video/et61x251/et61x251_core.c

@@ -588,7 +588,7 @@ static int et61x251_stream_interrupt(struct et61x251_device* cam)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "URB timeout reached. The camera is misconfigured. To "
 		DBG(1, "URB timeout reached. The camera is misconfigured. To "
 		       "use it, close and open /dev/video%d again.",
 		       "use it, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -1195,7 +1195,7 @@ static void et61x251_release_resources(struct kref *kref)
 
 
 	cam = container_of(kref, struct et61x251_device, kref);
 	cam = container_of(kref, struct et61x251_device, kref);
 
 
-	DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor);
+	DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_unregister_device(cam->v4ldev);
 	video_unregister_device(cam->v4ldev);
 	usb_put_dev(cam->usbdev);
 	usb_put_dev(cam->usbdev);
@@ -1237,7 +1237,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
 
 
 	if (cam->users) {
 	if (cam->users) {
 		DBG(2, "Device /dev/video%d is already in use",
 		DBG(2, "Device /dev/video%d is already in use",
-		       cam->v4ldev->minor);
+		       cam->v4ldev->num);
 		DBG(3, "Simultaneous opens are not supported");
 		DBG(3, "Simultaneous opens are not supported");
 		if ((filp->f_flags & O_NONBLOCK) ||
 		if ((filp->f_flags & O_NONBLOCK) ||
 		    (filp->f_flags & O_NDELAY)) {
 		    (filp->f_flags & O_NDELAY)) {
@@ -1280,7 +1280,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
 	cam->frame_count = 0;
 	cam->frame_count = 0;
 	et61x251_empty_framequeues(cam);
 	et61x251_empty_framequeues(cam);
 
 
-	DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor);
+	DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
 
 
 out:
 out:
 	mutex_unlock(&cam->open_mutex);
 	mutex_unlock(&cam->open_mutex);
@@ -1304,7 +1304,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
 	cam->users--;
 	cam->users--;
 	wake_up_interruptible_nr(&cam->wait_open, 1);
 	wake_up_interruptible_nr(&cam->wait_open, 1);
 
 
-	DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor);
+	DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
 
 
 	kref_put(&cam->kref, et61x251_release_resources);
 	kref_put(&cam->kref, et61x251_release_resources);
 
 
@@ -1845,7 +1845,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
 		DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -1858,7 +1858,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
 		DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 
 
@@ -2068,7 +2068,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
 		DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -2080,7 +2080,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
 		DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 
 
@@ -2128,7 +2128,7 @@ et61x251_vidioc_s_jpegcomp(struct et61x251_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
 		DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
 		       "problems. To use the camera, close and open "
 		       "problems. To use the camera, close and open "
-		       "/dev/video%d again.", cam->v4ldev->minor);
+		       "/dev/video%d again.", cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -2605,7 +2605,7 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 		goto fail;
 		goto fail;
 	}
 	}
 
 
-	DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
+	DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
 
 
 	cam->module_param.force_munmap = force_munmap[dev_nr];
 	cam->module_param.force_munmap = force_munmap[dev_nr];
 	cam->module_param.frame_timeout = frame_timeout[dev_nr];
 	cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2658,7 +2658,7 @@ static void et61x251_usb_disconnect(struct usb_interface* intf)
 	if (cam->users) {
 	if (cam->users) {
 		DBG(2, "Device /dev/video%d is open! Deregistration and "
 		DBG(2, "Device /dev/video%d is open! Deregistration and "
 		       "memory deallocation are deferred.",
 		       "memory deallocation are deferred.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		et61x251_stop_transfer(cam);
 		et61x251_stop_transfer(cam);
 		cam->state |= DEV_DISCONNECTED;
 		cam->state |= DEV_DISCONNECTED;

+ 12 - 0
drivers/media/video/ivtv/ivtv-driver.c

@@ -1211,6 +1211,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
 
 
 	if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
 	if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
 		ivtv_call_i2c_clients(itv, VIDIOC_INT_S_STD_OUTPUT, &itv->std);
 		ivtv_call_i2c_clients(itv, VIDIOC_INT_S_STD_OUTPUT, &itv->std);
+		/* Turn off the output signal. The mpeg decoder is not yet
+		   active so without this you would get a green image until the
+		   mpeg decoder becomes active. */
+		ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
 	}
 	}
 
 
 	/* clear interrupt mask, effectively disabling interrupts */
 	/* clear interrupt mask, effectively disabling interrupts */
@@ -1330,6 +1334,10 @@ int ivtv_init_on_first_open(struct ivtv *itv)
 	ivtv_s_frequency(NULL, &fh, &vf);
 	ivtv_s_frequency(NULL, &fh, &vf);
 
 
 	if (itv->card->v4l2_capabilities & V4L2_CAP_VIDEO_OUTPUT) {
 	if (itv->card->v4l2_capabilities & V4L2_CAP_VIDEO_OUTPUT) {
+		/* Turn on the TV-out: ivtv_init_mpeg_decoder() initializes
+		   the mpeg decoder so now the saa7127 receives a proper
+		   signal. */
+		ivtv_saa7127(itv, VIDIOC_STREAMON, NULL);
 		ivtv_init_mpeg_decoder(itv);
 		ivtv_init_mpeg_decoder(itv);
 	}
 	}
 	ivtv_s_std(NULL, &fh, &itv->tuner_std);
 	ivtv_s_std(NULL, &fh, &itv->tuner_std);
@@ -1366,6 +1374,10 @@ static void ivtv_remove(struct pci_dev *pci_dev)
 
 
 		/* Stop all decoding */
 		/* Stop all decoding */
 		IVTV_DEBUG_INFO("Stopping decoding\n");
 		IVTV_DEBUG_INFO("Stopping decoding\n");
+
+		/* Turn off the TV-out */
+		if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)
+			ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
 		if (atomic_read(&itv->decoding) > 0) {
 		if (atomic_read(&itv->decoding) > 0) {
 			int type;
 			int type;
 
 

+ 1 - 0
drivers/media/video/ivtv/ivtv-i2c.c

@@ -726,6 +726,7 @@ int ivtv_saa7127(struct ivtv *itv, unsigned int cmd, void *arg)
 {
 {
 	return ivtv_call_i2c_client(itv, IVTV_SAA7127_I2C_ADDR, cmd, arg);
 	return ivtv_call_i2c_client(itv, IVTV_SAA7127_I2C_ADDR, cmd, arg);
 }
 }
+EXPORT_SYMBOL(ivtv_saa7127);
 
 
 int ivtv_saa717x(struct ivtv *itv, unsigned int cmd, void *arg)
 int ivtv_saa717x(struct ivtv *itv, unsigned int cmd, void *arg)
 {
 {

+ 6 - 7
drivers/media/video/ivtv/ivtv-ioctl.c

@@ -1756,12 +1756,12 @@ static int ivtv_default(struct file *file, void *fh, int cmd, void *arg)
 	return 0;
 	return 0;
 }
 }
 
 
-static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct file *filp,
+static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp,
 		unsigned int cmd, unsigned long arg)
 		unsigned int cmd, unsigned long arg)
 {
 {
 	struct video_device *vfd = video_devdata(filp);
 	struct video_device *vfd = video_devdata(filp);
 	struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
 	struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
-	int ret;
+	long ret;
 
 
 	/* Filter dvb ioctls that cannot be handled by the v4l ioctl framework */
 	/* Filter dvb ioctls that cannot be handled by the v4l ioctl framework */
 	switch (cmd) {
 	switch (cmd) {
@@ -1830,20 +1830,19 @@ static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct f
 
 
 	if (ivtv_debug & IVTV_DBGFLG_IOCTL)
 	if (ivtv_debug & IVTV_DBGFLG_IOCTL)
 		vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
 		vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
-	ret = video_ioctl2(inode, filp, cmd, arg);
+	ret = __video_ioctl2(filp, cmd, arg);
 	vfd->debug = 0;
 	vfd->debug = 0;
 	return ret;
 	return ret;
 }
 }
 
 
-int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
-		    unsigned long arg)
+long ivtv_v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
 {
 	struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
 	struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
 	struct ivtv *itv = id->itv;
 	struct ivtv *itv = id->itv;
-	int res;
+	long res;
 
 
 	mutex_lock(&itv->serialize_lock);
 	mutex_lock(&itv->serialize_lock);
-	res = ivtv_serialized_ioctl(itv, inode, filp, cmd, arg);
+	res = ivtv_serialized_ioctl(itv, filp, cmd, arg);
 	mutex_unlock(&itv->serialize_lock);
 	mutex_unlock(&itv->serialize_lock);
 	return res;
 	return res;
 }
 }

+ 1 - 2
drivers/media/video/ivtv/ivtv-ioctl.h

@@ -30,7 +30,6 @@ void ivtv_set_funcs(struct video_device *vdev);
 int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std);
 int ivtv_s_std(struct file *file, void *fh, v4l2_std_id *std);
 int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
 int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
 int ivtv_s_input(struct file *file, void *fh, unsigned int inp);
 int ivtv_s_input(struct file *file, void *fh, unsigned int inp);
-int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
-		    unsigned long arg);
+long ivtv_v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 
 
 #endif
 #endif

+ 2 - 2
drivers/media/video/ivtv/ivtv-streams.c

@@ -48,7 +48,7 @@ static const struct file_operations ivtv_v4l2_enc_fops = {
 	.read = ivtv_v4l2_read,
 	.read = ivtv_v4l2_read,
 	.write = ivtv_v4l2_write,
 	.write = ivtv_v4l2_write,
 	.open = ivtv_v4l2_open,
 	.open = ivtv_v4l2_open,
-	.ioctl = ivtv_v4l2_ioctl,
+	.unlocked_ioctl = ivtv_v4l2_ioctl,
 	.compat_ioctl = v4l_compat_ioctl32,
 	.compat_ioctl = v4l_compat_ioctl32,
 	.release = ivtv_v4l2_close,
 	.release = ivtv_v4l2_close,
 	.poll = ivtv_v4l2_enc_poll,
 	.poll = ivtv_v4l2_enc_poll,
@@ -59,7 +59,7 @@ static const struct file_operations ivtv_v4l2_dec_fops = {
 	.read = ivtv_v4l2_read,
 	.read = ivtv_v4l2_read,
 	.write = ivtv_v4l2_write,
 	.write = ivtv_v4l2_write,
 	.open = ivtv_v4l2_open,
 	.open = ivtv_v4l2_open,
-	.ioctl = ivtv_v4l2_ioctl,
+	.unlocked_ioctl = ivtv_v4l2_ioctl,
 	.compat_ioctl = v4l_compat_ioctl32,
 	.compat_ioctl = v4l_compat_ioctl32,
 	.release = ivtv_v4l2_close,
 	.release = ivtv_v4l2_close,
 	.poll = ivtv_v4l2_dec_poll,
 	.poll = ivtv_v4l2_dec_poll,

+ 6 - 0
drivers/media/video/ivtv/ivtvfb.c

@@ -48,6 +48,7 @@
 #endif
 #endif
 
 
 #include "ivtv-driver.h"
 #include "ivtv-driver.h"
+#include "ivtv-i2c.h"
 #include "ivtv-udma.h"
 #include "ivtv-udma.h"
 #include "ivtv-mailbox.h"
 #include "ivtv-mailbox.h"
 
 
@@ -894,11 +895,16 @@ static int ivtvfb_blank(int blank_mode, struct fb_info *info)
 	switch (blank_mode) {
 	switch (blank_mode) {
 	case FB_BLANK_UNBLANK:
 	case FB_BLANK_UNBLANK:
 		ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 1);
 		ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 1);
+		ivtv_saa7127(itv, VIDIOC_STREAMON, NULL);
 		break;
 		break;
 	case FB_BLANK_NORMAL:
 	case FB_BLANK_NORMAL:
 	case FB_BLANK_HSYNC_SUSPEND:
 	case FB_BLANK_HSYNC_SUSPEND:
 	case FB_BLANK_VSYNC_SUSPEND:
 	case FB_BLANK_VSYNC_SUSPEND:
+		ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0);
+		ivtv_saa7127(itv, VIDIOC_STREAMON, NULL);
+		break;
 	case FB_BLANK_POWERDOWN:
 	case FB_BLANK_POWERDOWN:
+		ivtv_saa7127(itv, VIDIOC_STREAMOFF, NULL);
 		ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0);
 		ivtv_vapi(itv, CX2341X_OSD_SET_STATE, 1, 0);
 		break;
 		break;
 	}
 	}

+ 4 - 0
drivers/media/video/pvrusb2/pvrusb2-encoder.c

@@ -402,6 +402,10 @@ static int pvr2_encoder_prep_config(struct pvr2_hdw *hdw)
 	ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 0,3,0,0);
 	ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4, 0,3,0,0);
 	ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4,15,0,0,0);
 	ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC,4,15,0,0,0);
 
 
+	/* prevent the PTSs from slowly drifting away in the generated
+	   MPEG stream */
+	ret |= pvr2_encoder_vcmd(hdw, CX2341X_ENC_MISC, 2, 4, 1);
+
 	return ret;
 	return ret;
 }
 }
 
 

+ 0 - 6
drivers/media/video/pvrusb2/pvrusb2-hdw.c

@@ -60,7 +60,6 @@ static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL};
 static DEFINE_MUTEX(pvr2_unit_mtx);
 static DEFINE_MUTEX(pvr2_unit_mtx);
 
 
 static int ctlchg;
 static int ctlchg;
-static int initusbreset = 1;
 static int procreload;
 static int procreload;
 static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 };
 static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 };
 static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 };
 static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 };
@@ -71,8 +70,6 @@ module_param(ctlchg, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value");
 MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value");
 module_param(init_pause_msec, int, S_IRUGO|S_IWUSR);
 module_param(init_pause_msec, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay");
 MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay");
-module_param(initusbreset, int, S_IRUGO|S_IWUSR);
-MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe");
 module_param(procreload, int, S_IRUGO|S_IWUSR);
 module_param(procreload, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(procreload,
 MODULE_PARM_DESC(procreload,
 		 "Attempt init failure recovery with firmware reload");
 		 "Attempt init failure recovery with firmware reload");
@@ -1967,9 +1964,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
 	}
 	}
 	hdw->fw1_state = FW1_STATE_OK;
 	hdw->fw1_state = FW1_STATE_OK;
 
 
-	if (initusbreset) {
-		pvr2_hdw_device_reset(hdw);
-	}
 	if (!pvr2_hdw_dev_ok(hdw)) return;
 	if (!pvr2_hdw_dev_ok(hdw)) return;
 
 
 	for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) {
 	for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) {

+ 11 - 6
drivers/media/video/pvrusb2/pvrusb2-v4l2.c

@@ -168,7 +168,7 @@ static const char *get_v4l_name(int v4l_type)
  * This is part of Video 4 Linux API. The procedure handles ioctl() calls.
  * This is part of Video 4 Linux API. The procedure handles ioctl() calls.
  *
  *
  */
  */
-static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
+static int __pvr2_v4l2_do_ioctl(struct file *file,
 			      unsigned int cmd, void *arg)
 			      unsigned int cmd, void *arg)
 {
 {
 	struct pvr2_v4l2_fh *fh = file->private_data;
 	struct pvr2_v4l2_fh *fh = file->private_data;
@@ -863,8 +863,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
 #endif
 #endif
 
 
 	default :
 	default :
-		ret = v4l_compat_translate_ioctl(inode,file,cmd,
-						 arg,pvr2_v4l2_do_ioctl);
+		ret = v4l_compat_translate_ioctl(file, cmd,
+						 arg, __pvr2_v4l2_do_ioctl);
 	}
 	}
 
 
 	pvr2_hdw_commit_ctl(hdw);
 	pvr2_hdw_commit_ctl(hdw);
@@ -890,10 +890,15 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
 	return ret;
 	return ret;
 }
 }
 
 
+static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
+			      unsigned int cmd, void *arg)
+{
+	return __pvr2_v4l2_do_ioctl(file, cmd, arg);
+}
 
 
 static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
 static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
 {
 {
-	int minor_id = dip->devbase.minor;
+	int num = dip->devbase.num;
 	struct pvr2_hdw *hdw = dip->v4lp->channel.mc_head->hdw;
 	struct pvr2_hdw *hdw = dip->v4lp->channel.mc_head->hdw;
 	enum pvr2_config cfg = dip->config;
 	enum pvr2_config cfg = dip->config;
 	int v4l_type = dip->v4l_type;
 	int v4l_type = dip->v4l_type;
@@ -909,7 +914,7 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
 	video_unregister_device(&dip->devbase);
 	video_unregister_device(&dip->devbase);
 
 
 	printk(KERN_INFO "pvrusb2: unregistered device %s%u [%s]\n",
 	printk(KERN_INFO "pvrusb2: unregistered device %s%u [%s]\n",
-	       get_v4l_name(v4l_type),minor_id & 0x1f,
+	       get_v4l_name(v4l_type), num,
 	       pvr2_config_get_name(cfg));
 	       pvr2_config_get_name(cfg));
 
 
 }
 }
@@ -1310,7 +1315,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
 	}
 	}
 
 
 	printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n",
 	printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n",
-	       get_v4l_name(dip->v4l_type),dip->devbase.minor & 0x1f,
+	       get_v4l_name(dip->v4l_type), dip->devbase.num,
 	       pvr2_config_get_name(dip->config));
 	       pvr2_config_get_name(dip->config));
 
 
 	pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw,
 	pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw,

+ 1 - 1
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
 		goto err;
 		goto err;
 	}
 	}
 	else {
 	else {
-		PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F);
+		PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->num);
 	}
 	}
 
 
 	/* occupy slot */
 	/* occupy slot */

+ 3 - 3
drivers/media/video/saa7134/saa7134-core.c

@@ -996,7 +996,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 		goto fail4;
 		goto fail4;
 	}
 	}
 	printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
 	printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
-	       dev->name,dev->video_dev->minor & 0x1f);
+	       dev->name, dev->video_dev->num);
 
 
 	dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
 	dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
 
 
@@ -1005,7 +1005,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 	if (err < 0)
 	if (err < 0)
 		goto fail4;
 		goto fail4;
 	printk(KERN_INFO "%s: registered device vbi%d\n",
 	printk(KERN_INFO "%s: registered device vbi%d\n",
-	       dev->name,dev->vbi_dev->minor & 0x1f);
+	       dev->name, dev->vbi_dev->num);
 
 
 	if (card_has_radio(dev)) {
 	if (card_has_radio(dev)) {
 		dev->radio_dev = vdev_init(dev,&saa7134_radio_template,"radio");
 		dev->radio_dev = vdev_init(dev,&saa7134_radio_template,"radio");
@@ -1014,7 +1014,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 		if (err < 0)
 		if (err < 0)
 			goto fail4;
 			goto fail4;
 		printk(KERN_INFO "%s: registered device radio%d\n",
 		printk(KERN_INFO "%s: registered device radio%d\n",
-		       dev->name,dev->radio_dev->minor & 0x1f);
+		       dev->name, dev->radio_dev->num);
 	}
 	}
 
 
 	/* everything worked */
 	/* everything worked */

+ 1 - 1
drivers/media/video/saa7134/saa7134-empress.c

@@ -534,7 +534,7 @@ static int empress_init(struct saa7134_dev *dev)
 		return err;
 		return err;
 	}
 	}
 	printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
 	printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
-	       dev->name,dev->empress_dev->minor & 0x1f);
+	       dev->name, dev->empress_dev->num);
 
 
 	videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops,
 	videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops,
 			    &dev->pci->dev, &dev->slock,
 			    &dev->pci->dev, &dev->slock,

+ 1 - 1
drivers/media/video/se401.c

@@ -1412,7 +1412,7 @@ static int se401_probe(struct usb_interface *intf,
 		return -EIO;
 		return -EIO;
 	}
 	}
 	dev_info(&intf->dev, "registered new video device: video%d\n",
 	dev_info(&intf->dev, "registered new video device: video%d\n",
-		 se401->vdev.minor);
+		 se401->vdev.num);
 
 
 	usb_set_intfdata (intf, se401);
 	usb_set_intfdata (intf, se401);
 	return 0;
 	return 0;

+ 12 - 12
drivers/media/video/sn9c102/sn9c102_core.c

@@ -1008,7 +1008,7 @@ static int sn9c102_stream_interrupt(struct sn9c102_device* cam)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "URB timeout reached. The camera is misconfigured. "
 		DBG(1, "URB timeout reached. The camera is misconfigured. "
 		       "To use it, close and open /dev/video%d again.",
 		       "To use it, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -1734,7 +1734,7 @@ static void sn9c102_release_resources(struct kref *kref)
 
 
 	cam = container_of(kref, struct sn9c102_device, kref);
 	cam = container_of(kref, struct sn9c102_device, kref);
 
 
-	DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor);
+	DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_unregister_device(cam->v4ldev);
 	video_unregister_device(cam->v4ldev);
 	usb_put_dev(cam->usbdev);
 	usb_put_dev(cam->usbdev);
@@ -1792,7 +1792,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
 
 
 	if (cam->users) {
 	if (cam->users) {
 		DBG(2, "Device /dev/video%d is already in use",
 		DBG(2, "Device /dev/video%d is already in use",
-		       cam->v4ldev->minor);
+		       cam->v4ldev->num);
 		DBG(3, "Simultaneous opens are not supported");
 		DBG(3, "Simultaneous opens are not supported");
 		/*
 		/*
 		   open() must follow the open flags and should block
 		   open() must follow the open flags and should block
@@ -1845,7 +1845,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
 	cam->frame_count = 0;
 	cam->frame_count = 0;
 	sn9c102_empty_framequeues(cam);
 	sn9c102_empty_framequeues(cam);
 
 
-	DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor);
+	DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
 
 
 out:
 out:
 	mutex_unlock(&cam->open_mutex);
 	mutex_unlock(&cam->open_mutex);
@@ -1870,7 +1870,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
 	cam->users--;
 	cam->users--;
 	wake_up_interruptible_nr(&cam->wait_open, 1);
 	wake_up_interruptible_nr(&cam->wait_open, 1);
 
 
-	DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor);
+	DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
 
 
 	kref_put(&cam->kref, sn9c102_release_resources);
 	kref_put(&cam->kref, sn9c102_release_resources);
 
 
@@ -2432,7 +2432,7 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
 		DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -2445,7 +2445,7 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
 		DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 
 
@@ -2689,7 +2689,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
 		DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -2701,7 +2701,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
 		DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 
 
@@ -2748,7 +2748,7 @@ sn9c102_vidioc_s_jpegcomp(struct sn9c102_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
 		DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
 		       "problems. To use the camera, close and open "
 		       "problems. To use the camera, close and open "
-		       "/dev/video%d again.", cam->v4ldev->minor);
+		       "/dev/video%d again.", cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -3348,7 +3348,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 		goto fail;
 		goto fail;
 	}
 	}
 
 
-	DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
+	DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
 
 
 	video_set_drvdata(cam->v4ldev, cam);
 	video_set_drvdata(cam->v4ldev, cam);
 	cam->module_param.force_munmap = force_munmap[dev_nr];
 	cam->module_param.force_munmap = force_munmap[dev_nr];
@@ -3402,7 +3402,7 @@ static void sn9c102_usb_disconnect(struct usb_interface* intf)
 	if (cam->users) {
 	if (cam->users) {
 		DBG(2, "Device /dev/video%d is open! Deregistration and "
 		DBG(2, "Device /dev/video%d is open! Deregistration and "
 		       "memory deallocation are deferred.",
 		       "memory deallocation are deferred.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		sn9c102_stop_transfer(cam);
 		sn9c102_stop_transfer(cam);
 		cam->state |= DEV_DISCONNECTED;
 		cam->state |= DEV_DISCONNECTED;

+ 2 - 2
drivers/media/video/stk-webcam.c

@@ -1331,7 +1331,7 @@ static int stk_register_video_device(struct stk_camera *dev)
 		STK_ERROR("v4l registration failed\n");
 		STK_ERROR("v4l registration failed\n");
 	else
 	else
 		STK_INFO("Syntek USB2.0 Camera is now controlling video device"
 		STK_INFO("Syntek USB2.0 Camera is now controlling video device"
-			" /dev/video%d\n", dev->vdev.minor);
+			" /dev/video%d\n", dev->vdev.num);
 	return err;
 	return err;
 }
 }
 
 
@@ -1426,7 +1426,7 @@ static void stk_camera_disconnect(struct usb_interface *interface)
 	stk_remove_sysfs_files(&dev->vdev);
 	stk_remove_sysfs_files(&dev->vdev);
 
 
 	STK_INFO("Syntek USB2.0 Camera release resources "
 	STK_INFO("Syntek USB2.0 Camera release resources "
-		"video device /dev/video%d\n", dev->vdev.minor);
+		"video device /dev/video%d\n", dev->vdev.num);
 
 
 	video_unregister_device(&dev->vdev);
 	video_unregister_device(&dev->vdev);
 }
 }

+ 2 - 1
drivers/media/video/stv680.c

@@ -1470,7 +1470,8 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
 		retval = -EIO;
 		retval = -EIO;
 		goto error_vdev;
 		goto error_vdev;
 	}
 	}
-	PDEBUG (0, "STV(i): registered new video device: video%d", stv680->vdev->minor);
+	PDEBUG(0, "STV(i): registered new video device: video%d",
+		stv680->vdev->num);
 
 
 	usb_set_intfdata (intf, stv680);
 	usb_set_intfdata (intf, stv680);
 	retval = stv680_create_sysfs_files(stv680->vdev);
 	retval = stv680_create_sysfs_files(stv680->vdev);

+ 1 - 1
drivers/media/video/usbvideo/usbvideo.c

@@ -1059,7 +1059,7 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
 
 
 	dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n",
 	dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n",
 		 (uvd->handle != NULL) ? uvd->handle->drvName : "???",
 		 (uvd->handle != NULL) ? uvd->handle->drvName : "???",
-		 uvd->vdev.minor, tmp2, tmp1);
+		 uvd->vdev.num, tmp2, tmp1);
 
 
 	usb_get_dev(uvd->dev);
 	usb_get_dev(uvd->dev);
 	return 0;
 	return 0;

+ 2 - 1
drivers/media/video/usbvideo/vicam.c

@@ -877,7 +877,8 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
-	printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",cam->vdev.minor);
+	printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",
+			cam->vdev.num);
 
 
 	usb_set_intfdata (intf, cam);
 	usb_set_intfdata (intf, cam);
 
 

+ 1 - 1
drivers/media/video/usbvision/usbvision-i2c.c

@@ -236,7 +236,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
 	       sizeof(struct i2c_client));
 	       sizeof(struct i2c_client));
 
 
 	sprintf(usbvision->i2c_adap.name + strlen(usbvision->i2c_adap.name),
 	sprintf(usbvision->i2c_adap.name + strlen(usbvision->i2c_adap.name),
-		" #%d", usbvision->vdev->minor & 0x1f);
+		" #%d", usbvision->vdev->num);
 	PDEBUG(DBG_I2C,"Adaptername: %s", usbvision->i2c_adap.name);
 	PDEBUG(DBG_I2C,"Adaptername: %s", usbvision->i2c_adap.name);
 	usbvision->i2c_adap.dev.parent = &usbvision->dev->dev;
 	usbvision->i2c_adap.dev.parent = &usbvision->dev->dev;
 
 

+ 6 - 6
drivers/media/video/usbvision/usbvision-video.c

@@ -1440,7 +1440,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 	// vbi Device:
 	// vbi Device:
 	if (usbvision->vbi) {
 	if (usbvision->vbi) {
 		PDEBUG(DBG_PROBE, "unregister /dev/vbi%d [v4l2]",
 		PDEBUG(DBG_PROBE, "unregister /dev/vbi%d [v4l2]",
-		       usbvision->vbi->minor & 0x1f);
+		       usbvision->vbi->num);
 		if (usbvision->vbi->minor != -1) {
 		if (usbvision->vbi->minor != -1) {
 			video_unregister_device(usbvision->vbi);
 			video_unregister_device(usbvision->vbi);
 		} else {
 		} else {
@@ -1452,7 +1452,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 	// Radio Device:
 	// Radio Device:
 	if (usbvision->rdev) {
 	if (usbvision->rdev) {
 		PDEBUG(DBG_PROBE, "unregister /dev/radio%d [v4l2]",
 		PDEBUG(DBG_PROBE, "unregister /dev/radio%d [v4l2]",
-		       usbvision->rdev->minor & 0x1f);
+		       usbvision->rdev->num);
 		if (usbvision->rdev->minor != -1) {
 		if (usbvision->rdev->minor != -1) {
 			video_unregister_device(usbvision->rdev);
 			video_unregister_device(usbvision->rdev);
 		} else {
 		} else {
@@ -1464,7 +1464,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 	// Video Device:
 	// Video Device:
 	if (usbvision->vdev) {
 	if (usbvision->vdev) {
 		PDEBUG(DBG_PROBE, "unregister /dev/video%d [v4l2]",
 		PDEBUG(DBG_PROBE, "unregister /dev/video%d [v4l2]",
-		       usbvision->vdev->minor & 0x1f);
+		       usbvision->vdev->num);
 		if (usbvision->vdev->minor != -1) {
 		if (usbvision->vdev->minor != -1) {
 			video_unregister_device(usbvision->vdev);
 			video_unregister_device(usbvision->vdev);
 		} else {
 		} else {
@@ -1490,7 +1490,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
 		goto err_exit;
 		goto err_exit;
 	}
 	}
 	printk(KERN_INFO "USBVision[%d]: registered USBVision Video device /dev/video%d [v4l2]\n",
 	printk(KERN_INFO "USBVision[%d]: registered USBVision Video device /dev/video%d [v4l2]\n",
-	       usbvision->nr,usbvision->vdev->minor & 0x1f);
+	       usbvision->nr, usbvision->vdev->num);
 
 
 	// Radio Device:
 	// Radio Device:
 	if (usbvision_device_data[usbvision->DevModel].Radio) {
 	if (usbvision_device_data[usbvision->DevModel].Radio) {
@@ -1507,7 +1507,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
 			goto err_exit;
 			goto err_exit;
 		}
 		}
 		printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device /dev/radio%d [v4l2]\n",
 		printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device /dev/radio%d [v4l2]\n",
-		       usbvision->nr, usbvision->rdev->minor & 0x1f);
+		       usbvision->nr, usbvision->rdev->num);
 	}
 	}
 	// vbi Device:
 	// vbi Device:
 	if (usbvision_device_data[usbvision->DevModel].vbi) {
 	if (usbvision_device_data[usbvision->DevModel].vbi) {
@@ -1523,7 +1523,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
 			goto err_exit;
 			goto err_exit;
 		}
 		}
 		printk(KERN_INFO "USBVision[%d]: registered USBVision VBI device /dev/vbi%d [v4l2] (Not Working Yet!)\n",
 		printk(KERN_INFO "USBVision[%d]: registered USBVision VBI device /dev/vbi%d [v4l2] (Not Working Yet!)\n",
-		       usbvision->nr,usbvision->vbi->minor & 0x1f);
+		       usbvision->nr, usbvision->vbi->num);
 	}
 	}
 	// all done
 	// all done
 	return 0;
 	return 0;

+ 9 - 3
drivers/media/video/uvc/uvc_v4l2.c

@@ -464,7 +464,7 @@ static int uvc_v4l2_release(struct inode *inode, struct file *file)
 	return 0;
 	return 0;
 }
 }
 
 
-static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
+static int __uvc_v4l2_do_ioctl(struct file *file,
 		     unsigned int cmd, void *arg)
 		     unsigned int cmd, void *arg)
 {
 {
 	struct video_device *vdev = video_devdata(file);
 	struct video_device *vdev = video_devdata(file);
@@ -978,8 +978,8 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
 		return uvc_xu_ctrl_query(video, arg, 1);
 		return uvc_xu_ctrl_query(video, arg, 1);
 
 
 	default:
 	default:
-		if ((ret = v4l_compat_translate_ioctl(inode, file, cmd, arg,
-			uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD)
+		if ((ret = v4l_compat_translate_ioctl(file, cmd, arg,
+			__uvc_v4l2_do_ioctl)) == -ENOIOCTLCMD)
 			uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n",
 			uvc_trace(UVC_TRACE_IOCTL, "Unknown ioctl 0x%08x\n",
 				  cmd);
 				  cmd);
 		return ret;
 		return ret;
@@ -988,6 +988,12 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
 	return ret;
 	return ret;
 }
 }
 
 
+static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
+			      unsigned int cmd, void *arg)
+{
+	return __uvc_v4l2_do_ioctl(file, cmd, arg);
+}
+
 static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
 static int uvc_v4l2_ioctl(struct inode *inode, struct file *file,
 		     unsigned int cmd, unsigned long arg)
 		     unsigned int cmd, unsigned long arg)
 {
 {

+ 98 - 123
drivers/media/video/v4l1-compat.c

@@ -57,8 +57,7 @@ MODULE_LICENSE("GPL");
  */
  */
 
 
 static int
 static int
-get_v4l_control(struct inode            *inode,
-		struct file             *file,
+get_v4l_control(struct file             *file,
 		int			cid,
 		int			cid,
 		v4l2_kioctl             drv)
 		v4l2_kioctl             drv)
 {
 {
@@ -67,12 +66,12 @@ get_v4l_control(struct inode            *inode,
 	int			err;
 	int			err;
 
 
 	qctrl2.id = cid;
 	qctrl2.id = cid;
-	err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2);
+	err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOC_QUERYCTRL: %d\n", err);
 		dprintk("VIDIOC_QUERYCTRL: %d\n", err);
 	if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) {
 	if (err == 0 && !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED)) {
 		ctrl2.id = qctrl2.id;
 		ctrl2.id = qctrl2.id;
-		err = drv(inode, file, VIDIOC_G_CTRL, &ctrl2);
+		err = drv(file, VIDIOC_G_CTRL, &ctrl2);
 		if (err < 0) {
 		if (err < 0) {
 			dprintk("VIDIOC_G_CTRL: %d\n", err);
 			dprintk("VIDIOC_G_CTRL: %d\n", err);
 			return 0;
 			return 0;
@@ -85,8 +84,7 @@ get_v4l_control(struct inode            *inode,
 }
 }
 
 
 static int
 static int
-set_v4l_control(struct inode            *inode,
-		struct file             *file,
+set_v4l_control(struct file             *file,
 		int			cid,
 		int			cid,
 		int			value,
 		int			value,
 		v4l2_kioctl             drv)
 		v4l2_kioctl             drv)
@@ -96,7 +94,7 @@ set_v4l_control(struct inode            *inode,
 	int			err;
 	int			err;
 
 
 	qctrl2.id = cid;
 	qctrl2.id = cid;
-	err = drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2);
+	err = drv(file, VIDIOC_QUERYCTRL, &qctrl2);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOC_QUERYCTRL: %d\n", err);
 		dprintk("VIDIOC_QUERYCTRL: %d\n", err);
 	if (err == 0 &&
 	if (err == 0 &&
@@ -114,7 +112,7 @@ set_v4l_control(struct inode            *inode,
 			 + 32767)
 			 + 32767)
 			/ 65535;
 			/ 65535;
 		ctrl2.value += qctrl2.minimum;
 		ctrl2.value += qctrl2.minimum;
-		err = drv(inode, file, VIDIOC_S_CTRL, &ctrl2);
+		err = drv(file, VIDIOC_S_CTRL, &ctrl2);
 		if (err < 0)
 		if (err < 0)
 			dprintk("VIDIOC_S_CTRL: %d\n", err);
 			dprintk("VIDIOC_S_CTRL: %d\n", err);
 	}
 	}
@@ -222,7 +220,6 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
 }
 }
 
 
 static int count_inputs(
 static int count_inputs(
-			struct inode *inode,
 			struct file *file,
 			struct file *file,
 			v4l2_kioctl drv)
 			v4l2_kioctl drv)
 {
 {
@@ -232,14 +229,13 @@ static int count_inputs(
 	for (i = 0;; i++) {
 	for (i = 0;; i++) {
 		memset(&input2, 0, sizeof(input2));
 		memset(&input2, 0, sizeof(input2));
 		input2.index = i;
 		input2.index = i;
-		if (0 != drv(inode, file, VIDIOC_ENUMINPUT, &input2))
+		if (0 != drv(file, VIDIOC_ENUMINPUT, &input2))
 			break;
 			break;
 	}
 	}
 	return i;
 	return i;
 }
 }
 
 
 static int check_size(
 static int check_size(
-		struct inode *inode,
 		struct file *file,
 		struct file *file,
 		v4l2_kioctl drv,
 		v4l2_kioctl drv,
 		int *maxw,
 		int *maxw,
@@ -252,14 +248,14 @@ static int check_size(
 	memset(&fmt2, 0, sizeof(fmt2));
 	memset(&fmt2, 0, sizeof(fmt2));
 
 
 	desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	desc2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	if (0 != drv(inode, file, VIDIOC_ENUM_FMT, &desc2))
+	if (0 != drv(file, VIDIOC_ENUM_FMT, &desc2))
 		goto done;
 		goto done;
 
 
 	fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	fmt2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	fmt2.fmt.pix.width       = 10000;
 	fmt2.fmt.pix.width       = 10000;
 	fmt2.fmt.pix.height      = 10000;
 	fmt2.fmt.pix.height      = 10000;
 	fmt2.fmt.pix.pixelformat = desc2.pixelformat;
 	fmt2.fmt.pix.pixelformat = desc2.pixelformat;
-	if (0 != drv(inode, file, VIDIOC_TRY_FMT, &fmt2))
+	if (0 != drv(file, VIDIOC_TRY_FMT, &fmt2))
 		goto done;
 		goto done;
 
 
 	*maxw = fmt2.fmt.pix.width;
 	*maxw = fmt2.fmt.pix.width;
@@ -273,7 +269,6 @@ done:
 
 
 static noinline int v4l1_compat_get_capabilities(
 static noinline int v4l1_compat_get_capabilities(
 					struct video_capability *cap,
 					struct video_capability *cap,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -289,13 +284,13 @@ static noinline int v4l1_compat_get_capabilities(
 	memset(cap, 0, sizeof(*cap));
 	memset(cap, 0, sizeof(*cap));
 	memset(&fbuf, 0, sizeof(fbuf));
 	memset(&fbuf, 0, sizeof(fbuf));
 
 
-	err = drv(inode, file, VIDIOC_QUERYCAP, cap2);
+	err = drv(file, VIDIOC_QUERYCAP, cap2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err);
 		dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err);
 		goto done;
 		goto done;
 	}
 	}
 	if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
 	if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
-		err = drv(inode, file, VIDIOC_G_FBUF, &fbuf);
+		err = drv(file, VIDIOC_G_FBUF, &fbuf);
 		if (err < 0) {
 		if (err < 0) {
 			dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err);
 			dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err);
 			memset(&fbuf, 0, sizeof(fbuf));
 			memset(&fbuf, 0, sizeof(fbuf));
@@ -317,8 +312,8 @@ static noinline int v4l1_compat_get_capabilities(
 	if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING)
 	if (fbuf.capability & V4L2_FBUF_CAP_LIST_CLIPPING)
 		cap->type |= VID_TYPE_CLIPPING;
 		cap->type |= VID_TYPE_CLIPPING;
 
 
-	cap->channels  = count_inputs(inode, file, drv);
-	check_size(inode, file, drv,
+	cap->channels  = count_inputs(file, drv);
+	check_size(file, drv,
 		   &cap->maxwidth, &cap->maxheight);
 		   &cap->maxwidth, &cap->maxheight);
 	cap->audios    =  0; /* FIXME */
 	cap->audios    =  0; /* FIXME */
 	cap->minwidth  = 48; /* FIXME */
 	cap->minwidth  = 48; /* FIXME */
@@ -331,7 +326,6 @@ done:
 
 
 static noinline int v4l1_compat_get_frame_buffer(
 static noinline int v4l1_compat_get_frame_buffer(
 					struct video_buffer *buffer,
 					struct video_buffer *buffer,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -341,7 +335,7 @@ static noinline int v4l1_compat_get_frame_buffer(
 	memset(buffer, 0, sizeof(*buffer));
 	memset(buffer, 0, sizeof(*buffer));
 	memset(&fbuf, 0, sizeof(fbuf));
 	memset(&fbuf, 0, sizeof(fbuf));
 
 
-	err = drv(inode, file, VIDIOC_G_FBUF, &fbuf);
+	err = drv(file, VIDIOC_G_FBUF, &fbuf);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err);
 		dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err);
 		goto done;
 		goto done;
@@ -386,7 +380,6 @@ done:
 
 
 static noinline int v4l1_compat_set_frame_buffer(
 static noinline int v4l1_compat_set_frame_buffer(
 					struct video_buffer *buffer,
 					struct video_buffer *buffer,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -415,7 +408,7 @@ static noinline int v4l1_compat_set_frame_buffer(
 		break;
 		break;
 	}
 	}
 	fbuf.fmt.bytesperline = buffer->bytesperline;
 	fbuf.fmt.bytesperline = buffer->bytesperline;
-	err = drv(inode, file, VIDIOC_S_FBUF, &fbuf);
+	err = drv(file, VIDIOC_S_FBUF, &fbuf);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err);
 		dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err);
 	return err;
 	return err;
@@ -423,7 +416,6 @@ static noinline int v4l1_compat_set_frame_buffer(
 
 
 static noinline int v4l1_compat_get_win_cap_dimensions(
 static noinline int v4l1_compat_get_win_cap_dimensions(
 					struct video_window *win,
 					struct video_window *win,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -438,7 +430,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
 	memset(win, 0, sizeof(*win));
 	memset(win, 0, sizeof(*win));
 
 
 	fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
 	fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
-	err = drv(inode, file, VIDIOC_G_FMT, fmt);
+	err = drv(file, VIDIOC_G_FMT, fmt);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err);
 		dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err);
 	if (err == 0) {
 	if (err == 0) {
@@ -453,7 +445,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
 	}
 	}
 
 
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	err = drv(inode, file, VIDIOC_G_FMT, fmt);
+	err = drv(file, VIDIOC_G_FMT, fmt);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err);
 		dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err);
 		goto done;
 		goto done;
@@ -472,7 +464,6 @@ done:
 
 
 static noinline int v4l1_compat_set_win_cap_dimensions(
 static noinline int v4l1_compat_set_win_cap_dimensions(
 					struct video_window *win,
 					struct video_window *win,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -485,8 +476,8 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
 		return err;
 		return err;
 	}
 	}
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	drv(inode, file, VIDIOC_STREAMOFF, &fmt->type);
-	err1 = drv(inode, file, VIDIOC_G_FMT, fmt);
+	drv(file, VIDIOC_STREAMOFF, &fmt->type);
+	err1 = drv(file, VIDIOC_G_FMT, fmt);
 	if (err1 < 0)
 	if (err1 < 0)
 		dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1);
 		dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1);
 	if (err1 == 0) {
 	if (err1 == 0) {
@@ -494,7 +485,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
 		fmt->fmt.pix.height = win->height;
 		fmt->fmt.pix.height = win->height;
 		fmt->fmt.pix.field  = V4L2_FIELD_ANY;
 		fmt->fmt.pix.field  = V4L2_FIELD_ANY;
 		fmt->fmt.pix.bytesperline = 0;
 		fmt->fmt.pix.bytesperline = 0;
-		err = drv(inode, file, VIDIOC_S_FMT, fmt);
+		err = drv(file, VIDIOC_S_FMT, fmt);
 		if (err < 0)
 		if (err < 0)
 			dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
 			dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n",
 				err);
 				err);
@@ -511,7 +502,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
 	fmt->fmt.win.chromakey = win->chromakey;
 	fmt->fmt.win.chromakey = win->chromakey;
 	fmt->fmt.win.clips     = (void __user *)win->clips;
 	fmt->fmt.win.clips     = (void __user *)win->clips;
 	fmt->fmt.win.clipcount = win->clipcount;
 	fmt->fmt.win.clipcount = win->clipcount;
-	err2 = drv(inode, file, VIDIOC_S_FMT, fmt);
+	err2 = drv(file, VIDIOC_S_FMT, fmt);
 	if (err2 < 0)
 	if (err2 < 0)
 		dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2);
 		dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2);
 
 
@@ -525,7 +516,6 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
 
 
 static noinline int v4l1_compat_turn_preview_on_off(
 static noinline int v4l1_compat_turn_preview_on_off(
 					int *on,
 					int *on,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -536,9 +526,9 @@ static noinline int v4l1_compat_turn_preview_on_off(
 		/* dirty hack time.  But v4l1 has no STREAMOFF
 		/* dirty hack time.  But v4l1 has no STREAMOFF
 		 * equivalent in the API, and this one at
 		 * equivalent in the API, and this one at
 		 * least comes close ... */
 		 * least comes close ... */
-		drv(inode, file, VIDIOC_STREAMOFF, &captype);
+		drv(file, VIDIOC_STREAMOFF, &captype);
 	}
 	}
-	err = drv(inode, file, VIDIOC_OVERLAY, on);
+	err = drv(file, VIDIOC_OVERLAY, on);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err);
 		dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err);
 	return err;
 	return err;
@@ -546,7 +536,6 @@ static noinline int v4l1_compat_turn_preview_on_off(
 
 
 static noinline int v4l1_compat_get_input_info(
 static noinline int v4l1_compat_get_input_info(
 					struct video_channel *chan,
 					struct video_channel *chan,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -556,7 +545,7 @@ static noinline int v4l1_compat_get_input_info(
 
 
 	memset(&input2, 0, sizeof(input2));
 	memset(&input2, 0, sizeof(input2));
 	input2.index = chan->channel;
 	input2.index = chan->channel;
-	err = drv(inode, file, VIDIOC_ENUMINPUT, &input2);
+	err = drv(file, VIDIOC_ENUMINPUT, &input2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
 		dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
 			"channel=%d err=%d\n", chan->channel, err);
 			"channel=%d err=%d\n", chan->channel, err);
@@ -578,7 +567,7 @@ static noinline int v4l1_compat_get_input_info(
 		break;
 		break;
 	}
 	}
 	chan->norm = 0;
 	chan->norm = 0;
-	err = drv(inode, file, VIDIOC_G_STD, &sid);
+	err = drv(file, VIDIOC_G_STD, &sid);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err);
 		dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err);
 	if (err == 0) {
 	if (err == 0) {
@@ -595,14 +584,13 @@ done:
 
 
 static noinline int v4l1_compat_set_input(
 static noinline int v4l1_compat_set_input(
 					struct video_channel *chan,
 					struct video_channel *chan,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
 	int err;
 	int err;
 	v4l2_std_id sid = 0;
 	v4l2_std_id sid = 0;
 
 
-	err = drv(inode, file, VIDIOC_S_INPUT, &chan->channel);
+	err = drv(file, VIDIOC_S_INPUT, &chan->channel);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err);
 		dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err);
 	switch (chan->norm) {
 	switch (chan->norm) {
@@ -617,7 +605,7 @@ static noinline int v4l1_compat_set_input(
 		break;
 		break;
 	}
 	}
 	if (0 != sid) {
 	if (0 != sid) {
-		err = drv(inode, file, VIDIOC_S_STD, &sid);
+		err = drv(file, VIDIOC_S_STD, &sid);
 		if (err < 0)
 		if (err < 0)
 			dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err);
 			dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err);
 	}
 	}
@@ -626,7 +614,6 @@ static noinline int v4l1_compat_set_input(
 
 
 static noinline int v4l1_compat_get_picture(
 static noinline int v4l1_compat_get_picture(
 					struct video_picture *pict,
 					struct video_picture *pict,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -639,19 +626,19 @@ static noinline int v4l1_compat_get_picture(
 		return err;
 		return err;
 	}
 	}
 
 
-	pict->brightness = get_v4l_control(inode, file,
+	pict->brightness = get_v4l_control(file,
 					   V4L2_CID_BRIGHTNESS, drv);
 					   V4L2_CID_BRIGHTNESS, drv);
-	pict->hue = get_v4l_control(inode, file,
+	pict->hue = get_v4l_control(file,
 				    V4L2_CID_HUE, drv);
 				    V4L2_CID_HUE, drv);
-	pict->contrast = get_v4l_control(inode, file,
+	pict->contrast = get_v4l_control(file,
 					 V4L2_CID_CONTRAST, drv);
 					 V4L2_CID_CONTRAST, drv);
-	pict->colour = get_v4l_control(inode, file,
+	pict->colour = get_v4l_control(file,
 				       V4L2_CID_SATURATION, drv);
 				       V4L2_CID_SATURATION, drv);
-	pict->whiteness = get_v4l_control(inode, file,
+	pict->whiteness = get_v4l_control(file,
 					  V4L2_CID_WHITENESS, drv);
 					  V4L2_CID_WHITENESS, drv);
 
 
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	err = drv(inode, file, VIDIOC_G_FMT, fmt);
+	err = drv(file, VIDIOC_G_FMT, fmt);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err);
 		dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err);
 		goto done;
 		goto done;
@@ -669,7 +656,6 @@ done:
 
 
 static noinline int v4l1_compat_set_picture(
 static noinline int v4l1_compat_set_picture(
 					struct video_picture *pict,
 					struct video_picture *pict,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -685,15 +671,15 @@ static noinline int v4l1_compat_set_picture(
 	}
 	}
 	memset(&fbuf, 0, sizeof(fbuf));
 	memset(&fbuf, 0, sizeof(fbuf));
 
 
-	set_v4l_control(inode, file,
+	set_v4l_control(file,
 			V4L2_CID_BRIGHTNESS, pict->brightness, drv);
 			V4L2_CID_BRIGHTNESS, pict->brightness, drv);
-	set_v4l_control(inode, file,
+	set_v4l_control(file,
 			V4L2_CID_HUE, pict->hue, drv);
 			V4L2_CID_HUE, pict->hue, drv);
-	set_v4l_control(inode, file,
+	set_v4l_control(file,
 			V4L2_CID_CONTRAST, pict->contrast, drv);
 			V4L2_CID_CONTRAST, pict->contrast, drv);
-	set_v4l_control(inode, file,
+	set_v4l_control(file,
 			V4L2_CID_SATURATION, pict->colour, drv);
 			V4L2_CID_SATURATION, pict->colour, drv);
-	set_v4l_control(inode, file,
+	set_v4l_control(file,
 			V4L2_CID_WHITENESS, pict->whiteness, drv);
 			V4L2_CID_WHITENESS, pict->whiteness, drv);
 	/*
 	/*
 	 * V4L1 uses this ioctl to set both memory capture and overlay
 	 * V4L1 uses this ioctl to set both memory capture and overlay
@@ -703,7 +689,7 @@ static noinline int v4l1_compat_set_picture(
 	 */
 	 */
 
 
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	err = drv(inode, file, VIDIOC_G_FMT, fmt);
+	err = drv(file, VIDIOC_G_FMT, fmt);
 	/* If VIDIOC_G_FMT failed, then the driver likely doesn't
 	/* If VIDIOC_G_FMT failed, then the driver likely doesn't
 	   support memory capture.  Trying to set the memory capture
 	   support memory capture.  Trying to set the memory capture
 	   parameters would be pointless.  */
 	   parameters would be pointless.  */
@@ -714,13 +700,13 @@ static noinline int v4l1_compat_set_picture(
 		 palette_to_pixelformat(pict->palette)) {
 		 palette_to_pixelformat(pict->palette)) {
 		fmt->fmt.pix.pixelformat = palette_to_pixelformat(
 		fmt->fmt.pix.pixelformat = palette_to_pixelformat(
 			pict->palette);
 			pict->palette);
-		mem_err = drv(inode, file, VIDIOC_S_FMT, fmt);
+		mem_err = drv(file, VIDIOC_S_FMT, fmt);
 		if (mem_err < 0)
 		if (mem_err < 0)
 			dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n",
 			dprintk("VIDIOCSPICT / VIDIOC_S_FMT: %d\n",
 				mem_err);
 				mem_err);
 	}
 	}
 
 
-	err = drv(inode, file, VIDIOC_G_FBUF, &fbuf);
+	err = drv(file, VIDIOC_G_FBUF, &fbuf);
 	/* If VIDIOC_G_FBUF failed, then the driver likely doesn't
 	/* If VIDIOC_G_FBUF failed, then the driver likely doesn't
 	   support overlay.  Trying to set the overlay parameters
 	   support overlay.  Trying to set the overlay parameters
 	   would be quite pointless.  */
 	   would be quite pointless.  */
@@ -731,7 +717,7 @@ static noinline int v4l1_compat_set_picture(
 		 palette_to_pixelformat(pict->palette)) {
 		 palette_to_pixelformat(pict->palette)) {
 		fbuf.fmt.pixelformat = palette_to_pixelformat(
 		fbuf.fmt.pixelformat = palette_to_pixelformat(
 			pict->palette);
 			pict->palette);
-		ovl_err = drv(inode, file, VIDIOC_S_FBUF, &fbuf);
+		ovl_err = drv(file, VIDIOC_S_FBUF, &fbuf);
 		if (ovl_err < 0)
 		if (ovl_err < 0)
 			dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n",
 			dprintk("VIDIOCSPICT / VIDIOC_S_FBUF: %d\n",
 				ovl_err);
 				ovl_err);
@@ -752,7 +738,6 @@ static noinline int v4l1_compat_set_picture(
 
 
 static noinline int v4l1_compat_get_tuner(
 static noinline int v4l1_compat_get_tuner(
 					struct video_tuner *tun,
 					struct video_tuner *tun,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -762,7 +747,7 @@ static noinline int v4l1_compat_get_tuner(
 	v4l2_std_id    		sid;
 	v4l2_std_id    		sid;
 
 
 	memset(&tun2, 0, sizeof(tun2));
 	memset(&tun2, 0, sizeof(tun2));
-	err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
+	err = drv(file, VIDIOC_G_TUNER, &tun2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err);
 		dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err);
 		goto done;
 		goto done;
@@ -778,7 +763,7 @@ static noinline int v4l1_compat_get_tuner(
 	for (i = 0; i < 64; i++) {
 	for (i = 0; i < 64; i++) {
 		memset(&std2, 0, sizeof(std2));
 		memset(&std2, 0, sizeof(std2));
 		std2.index = i;
 		std2.index = i;
-		if (0 != drv(inode, file, VIDIOC_ENUMSTD, &std2))
+		if (0 != drv(file, VIDIOC_ENUMSTD, &std2))
 			break;
 			break;
 		if (std2.id & V4L2_STD_PAL)
 		if (std2.id & V4L2_STD_PAL)
 			tun->flags |= VIDEO_TUNER_PAL;
 			tun->flags |= VIDEO_TUNER_PAL;
@@ -788,7 +773,7 @@ static noinline int v4l1_compat_get_tuner(
 			tun->flags |= VIDEO_TUNER_SECAM;
 			tun->flags |= VIDEO_TUNER_SECAM;
 	}
 	}
 
 
-	err = drv(inode, file, VIDIOC_G_STD, &sid);
+	err = drv(file, VIDIOC_G_STD, &sid);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err);
 		dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err);
 	if (err == 0) {
 	if (err == 0) {
@@ -811,7 +796,6 @@ done:
 
 
 static noinline int v4l1_compat_select_tuner(
 static noinline int v4l1_compat_select_tuner(
 					struct video_tuner *tun,
 					struct video_tuner *tun,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -821,7 +805,7 @@ static noinline int v4l1_compat_select_tuner(
 
 
 	t.index = tun->tuner;
 	t.index = tun->tuner;
 
 
-	err = drv(inode, file, VIDIOC_S_INPUT, &t);
+	err = drv(file, VIDIOC_S_INPUT, &t);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err);
 		dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err);
 	return err;
 	return err;
@@ -829,7 +813,6 @@ static noinline int v4l1_compat_select_tuner(
 
 
 static noinline int v4l1_compat_get_frequency(
 static noinline int v4l1_compat_get_frequency(
 					unsigned long *freq,
 					unsigned long *freq,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -838,7 +821,7 @@ static noinline int v4l1_compat_get_frequency(
 	memset(&freq2, 0, sizeof(freq2));
 	memset(&freq2, 0, sizeof(freq2));
 
 
 	freq2.tuner = 0;
 	freq2.tuner = 0;
-	err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
+	err = drv(file, VIDIOC_G_FREQUENCY, &freq2);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err);
 		dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err);
 	if (0 == err)
 	if (0 == err)
@@ -848,7 +831,6 @@ static noinline int v4l1_compat_get_frequency(
 
 
 static noinline int v4l1_compat_set_frequency(
 static noinline int v4l1_compat_set_frequency(
 					unsigned long *freq,
 					unsigned long *freq,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -856,9 +838,9 @@ static noinline int v4l1_compat_set_frequency(
 	struct v4l2_frequency   freq2;
 	struct v4l2_frequency   freq2;
 	memset(&freq2, 0, sizeof(freq2));
 	memset(&freq2, 0, sizeof(freq2));
 
 
-	drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
+	drv(file, VIDIOC_G_FREQUENCY, &freq2);
 	freq2.frequency = *freq;
 	freq2.frequency = *freq;
-	err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2);
+	err = drv(file, VIDIOC_S_FREQUENCY, &freq2);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err);
 		dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err);
 	return err;
 	return err;
@@ -866,7 +848,6 @@ static noinline int v4l1_compat_set_frequency(
 
 
 static noinline int v4l1_compat_get_audio(
 static noinline int v4l1_compat_get_audio(
 					struct video_audio *aud,
 					struct video_audio *aud,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -876,7 +857,7 @@ static noinline int v4l1_compat_get_audio(
 	struct v4l2_tuner	tun2;
 	struct v4l2_tuner	tun2;
 	memset(&aud2, 0, sizeof(aud2));
 	memset(&aud2, 0, sizeof(aud2));
 
 
-	err = drv(inode, file, VIDIOC_G_AUDIO, &aud2);
+	err = drv(file, VIDIOC_G_AUDIO, &aud2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err);
 		dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err);
 		goto done;
 		goto done;
@@ -886,27 +867,27 @@ static noinline int v4l1_compat_get_audio(
 	aud->name[sizeof(aud->name) - 1] = 0;
 	aud->name[sizeof(aud->name) - 1] = 0;
 	aud->audio = aud2.index;
 	aud->audio = aud2.index;
 	aud->flags = 0;
 	aud->flags = 0;
-	i = get_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME, drv);
+	i = get_v4l_control(file, V4L2_CID_AUDIO_VOLUME, drv);
 	if (i >= 0) {
 	if (i >= 0) {
 		aud->volume = i;
 		aud->volume = i;
 		aud->flags |= VIDEO_AUDIO_VOLUME;
 		aud->flags |= VIDEO_AUDIO_VOLUME;
 	}
 	}
-	i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BASS, drv);
+	i = get_v4l_control(file, V4L2_CID_AUDIO_BASS, drv);
 	if (i >= 0) {
 	if (i >= 0) {
 		aud->bass = i;
 		aud->bass = i;
 		aud->flags |= VIDEO_AUDIO_BASS;
 		aud->flags |= VIDEO_AUDIO_BASS;
 	}
 	}
-	i = get_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE, drv);
+	i = get_v4l_control(file, V4L2_CID_AUDIO_TREBLE, drv);
 	if (i >= 0) {
 	if (i >= 0) {
 		aud->treble = i;
 		aud->treble = i;
 		aud->flags |= VIDEO_AUDIO_TREBLE;
 		aud->flags |= VIDEO_AUDIO_TREBLE;
 	}
 	}
-	i = get_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE, drv);
+	i = get_v4l_control(file, V4L2_CID_AUDIO_BALANCE, drv);
 	if (i >= 0) {
 	if (i >= 0) {
 		aud->balance = i;
 		aud->balance = i;
 		aud->flags |= VIDEO_AUDIO_BALANCE;
 		aud->flags |= VIDEO_AUDIO_BALANCE;
 	}
 	}
-	i = get_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE, drv);
+	i = get_v4l_control(file, V4L2_CID_AUDIO_MUTE, drv);
 	if (i >= 0) {
 	if (i >= 0) {
 		if (i)
 		if (i)
 			aud->flags |= VIDEO_AUDIO_MUTE;
 			aud->flags |= VIDEO_AUDIO_MUTE;
@@ -914,13 +895,13 @@ static noinline int v4l1_compat_get_audio(
 	}
 	}
 	aud->step = 1;
 	aud->step = 1;
 	qctrl2.id = V4L2_CID_AUDIO_VOLUME;
 	qctrl2.id = V4L2_CID_AUDIO_VOLUME;
-	if (drv(inode, file, VIDIOC_QUERYCTRL, &qctrl2) == 0 &&
+	if (drv(file, VIDIOC_QUERYCTRL, &qctrl2) == 0 &&
 	    !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
 	    !(qctrl2.flags & V4L2_CTRL_FLAG_DISABLED))
 		aud->step = qctrl2.step;
 		aud->step = qctrl2.step;
 	aud->mode = 0;
 	aud->mode = 0;
 
 
 	memset(&tun2, 0, sizeof(tun2));
 	memset(&tun2, 0, sizeof(tun2));
-	err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
+	err = drv(file, VIDIOC_G_TUNER, &tun2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err);
 		dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err);
 		err = 0;
 		err = 0;
@@ -939,7 +920,6 @@ done:
 
 
 static noinline int v4l1_compat_set_audio(
 static noinline int v4l1_compat_set_audio(
 					struct video_audio *aud,
 					struct video_audio *aud,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -951,24 +931,24 @@ static noinline int v4l1_compat_set_audio(
 	memset(&tun2, 0, sizeof(tun2));
 	memset(&tun2, 0, sizeof(tun2));
 
 
 	aud2.index = aud->audio;
 	aud2.index = aud->audio;
-	err = drv(inode, file, VIDIOC_S_AUDIO, &aud2);
+	err = drv(file, VIDIOC_S_AUDIO, &aud2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err);
 		dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err);
 		goto done;
 		goto done;
 	}
 	}
 
 
-	set_v4l_control(inode, file, V4L2_CID_AUDIO_VOLUME,
+	set_v4l_control(file, V4L2_CID_AUDIO_VOLUME,
 			aud->volume, drv);
 			aud->volume, drv);
-	set_v4l_control(inode, file, V4L2_CID_AUDIO_BASS,
+	set_v4l_control(file, V4L2_CID_AUDIO_BASS,
 			aud->bass, drv);
 			aud->bass, drv);
-	set_v4l_control(inode, file, V4L2_CID_AUDIO_TREBLE,
+	set_v4l_control(file, V4L2_CID_AUDIO_TREBLE,
 			aud->treble, drv);
 			aud->treble, drv);
-	set_v4l_control(inode, file, V4L2_CID_AUDIO_BALANCE,
+	set_v4l_control(file, V4L2_CID_AUDIO_BALANCE,
 			aud->balance, drv);
 			aud->balance, drv);
-	set_v4l_control(inode, file, V4L2_CID_AUDIO_MUTE,
+	set_v4l_control(file, V4L2_CID_AUDIO_MUTE,
 			!!(aud->flags & VIDEO_AUDIO_MUTE), drv);
 			!!(aud->flags & VIDEO_AUDIO_MUTE), drv);
 
 
-	err = drv(inode, file, VIDIOC_G_TUNER, &tun2);
+	err = drv(file, VIDIOC_G_TUNER, &tun2);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err);
 		dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err);
 	if (err == 0) {
 	if (err == 0) {
@@ -985,7 +965,7 @@ static noinline int v4l1_compat_set_audio(
 			tun2.audmode = V4L2_TUNER_MODE_LANG2;
 			tun2.audmode = V4L2_TUNER_MODE_LANG2;
 			break;
 			break;
 		}
 		}
-		err = drv(inode, file, VIDIOC_S_TUNER, &tun2);
+		err = drv(file, VIDIOC_S_TUNER, &tun2);
 		if (err < 0)
 		if (err < 0)
 			dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err);
 			dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err);
 	}
 	}
@@ -996,7 +976,6 @@ done:
 
 
 static noinline int v4l1_compat_capture_frame(
 static noinline int v4l1_compat_capture_frame(
 					struct video_mmap *mm,
 					struct video_mmap *mm,
-					struct inode *inode,
 					struct file *file,
 					struct file *file,
 					v4l2_kioctl drv)
 					v4l2_kioctl drv)
 {
 {
@@ -1013,7 +992,7 @@ static noinline int v4l1_compat_capture_frame(
 	memset(&buf, 0, sizeof(buf));
 	memset(&buf, 0, sizeof(buf));
 
 
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	err = drv(inode, file, VIDIOC_G_FMT, fmt);
+	err = drv(file, VIDIOC_G_FMT, fmt);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err);
 		dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err);
 		goto done;
 		goto done;
@@ -1029,7 +1008,7 @@ static noinline int v4l1_compat_capture_frame(
 			palette_to_pixelformat(mm->format);
 			palette_to_pixelformat(mm->format);
 		fmt->fmt.pix.field = V4L2_FIELD_ANY;
 		fmt->fmt.pix.field = V4L2_FIELD_ANY;
 		fmt->fmt.pix.bytesperline = 0;
 		fmt->fmt.pix.bytesperline = 0;
-		err = drv(inode, file, VIDIOC_S_FMT, fmt);
+		err = drv(file, VIDIOC_S_FMT, fmt);
 		if (err < 0) {
 		if (err < 0) {
 			dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err);
 			dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err);
 			goto done;
 			goto done;
@@ -1037,17 +1016,17 @@ static noinline int v4l1_compat_capture_frame(
 	}
 	}
 	buf.index = mm->frame;
 	buf.index = mm->frame;
 	buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	err = drv(inode, file, VIDIOC_QUERYBUF, &buf);
+	err = drv(file, VIDIOC_QUERYBUF, &buf);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err);
 		dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err);
 		goto done;
 		goto done;
 	}
 	}
-	err = drv(inode, file, VIDIOC_QBUF, &buf);
+	err = drv(file, VIDIOC_QBUF, &buf);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err);
 		dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err);
 		goto done;
 		goto done;
 	}
 	}
-	err = drv(inode, file, VIDIOC_STREAMON, &captype);
+	err = drv(file, VIDIOC_STREAMON, &captype);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err);
 		dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err);
 done:
 done:
@@ -1057,7 +1036,6 @@ done:
 
 
 static noinline int v4l1_compat_sync(
 static noinline int v4l1_compat_sync(
 				int *i,
 				int *i,
-				struct inode *inode,
 				struct file *file,
 				struct file *file,
 				v4l2_kioctl drv)
 				v4l2_kioctl drv)
 {
 {
@@ -1069,7 +1047,7 @@ static noinline int v4l1_compat_sync(
 	memset(&buf, 0, sizeof(buf));
 	memset(&buf, 0, sizeof(buf));
 	buf.index = *i;
 	buf.index = *i;
 	buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 	buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	err = drv(inode, file, VIDIOC_QUERYBUF, &buf);
+	err = drv(file, VIDIOC_QUERYBUF, &buf);
 	if (err < 0) {
 	if (err < 0) {
 		/*  No such buffer */
 		/*  No such buffer */
 		dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
 		dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
@@ -1082,7 +1060,7 @@ static noinline int v4l1_compat_sync(
 	}
 	}
 
 
 	/* make sure capture actually runs so we don't block forever */
 	/* make sure capture actually runs so we don't block forever */
-	err = drv(inode, file, VIDIOC_STREAMON, &captype);
+	err = drv(file, VIDIOC_STREAMON, &captype);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err);
 		dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err);
 		goto done;
 		goto done;
@@ -1096,7 +1074,7 @@ static noinline int v4l1_compat_sync(
 		if (err < 0 ||	/* error or sleep was interrupted  */
 		if (err < 0 ||	/* error or sleep was interrupted  */
 		    err == 0)	/* timeout? Shouldn't occur.  */
 		    err == 0)	/* timeout? Shouldn't occur.  */
 			break;
 			break;
-		err = drv(inode, file, VIDIOC_QUERYBUF, &buf);
+		err = drv(file, VIDIOC_QUERYBUF, &buf);
 		if (err < 0)
 		if (err < 0)
 			dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
 			dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err);
 	}
 	}
@@ -1104,7 +1082,7 @@ static noinline int v4l1_compat_sync(
 	if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
 	if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
 		goto done;
 		goto done;
 	do {
 	do {
-		err = drv(inode, file, VIDIOC_DQBUF, &buf);
+		err = drv(file, VIDIOC_DQBUF, &buf);
 		if (err < 0)
 		if (err < 0)
 			dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err);
 			dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err);
 	} while (err == 0 && buf.index != *i);
 	} while (err == 0 && buf.index != *i);
@@ -1114,7 +1092,6 @@ done:
 
 
 static noinline int v4l1_compat_get_vbi_format(
 static noinline int v4l1_compat_get_vbi_format(
 				struct vbi_format *fmt,
 				struct vbi_format *fmt,
-				struct inode *inode,
 				struct file *file,
 				struct file *file,
 				v4l2_kioctl drv)
 				v4l2_kioctl drv)
 {
 {
@@ -1128,7 +1105,7 @@ static noinline int v4l1_compat_get_vbi_format(
 	}
 	}
 	fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
 	fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
 
 
-	err = drv(inode, file, VIDIOC_G_FMT, fmt2);
+	err = drv(file, VIDIOC_G_FMT, fmt2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err);
 		dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err);
 		goto done;
 		goto done;
@@ -1153,7 +1130,6 @@ done:
 
 
 static noinline int v4l1_compat_set_vbi_format(
 static noinline int v4l1_compat_set_vbi_format(
 				struct vbi_format *fmt,
 				struct vbi_format *fmt,
-				struct inode *inode,
 				struct file *file,
 				struct file *file,
 				v4l2_kioctl drv)
 				v4l2_kioctl drv)
 {
 {
@@ -1179,7 +1155,7 @@ static noinline int v4l1_compat_set_vbi_format(
 	fmt2->fmt.vbi.start[1]         = fmt->start[1];
 	fmt2->fmt.vbi.start[1]         = fmt->start[1];
 	fmt2->fmt.vbi.count[1]         = fmt->count[1];
 	fmt2->fmt.vbi.count[1]         = fmt->count[1];
 	fmt2->fmt.vbi.flags            = fmt->flags;
 	fmt2->fmt.vbi.flags            = fmt->flags;
-	err = drv(inode, file, VIDIOC_TRY_FMT, fmt2);
+	err = drv(file, VIDIOC_TRY_FMT, fmt2);
 	if (err < 0) {
 	if (err < 0) {
 		dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err);
 		dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err);
 		goto done;
 		goto done;
@@ -1196,7 +1172,7 @@ static noinline int v4l1_compat_set_vbi_format(
 		err = -EINVAL;
 		err = -EINVAL;
 		goto done;
 		goto done;
 	}
 	}
-	err = drv(inode, file, VIDIOC_S_FMT, fmt2);
+	err = drv(file, VIDIOC_S_FMT, fmt2);
 	if (err < 0)
 	if (err < 0)
 		dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
 		dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err);
 done:
 done:
@@ -1208,8 +1184,7 @@ done:
  *	This function is exported.
  *	This function is exported.
  */
  */
 int
 int
-v4l_compat_translate_ioctl(struct inode         *inode,
-			   struct file		*file,
+v4l_compat_translate_ioctl(struct file		*file,
 			   int			cmd,
 			   int			cmd,
 			   void			*arg,
 			   void			*arg,
 			   v4l2_kioctl          drv)
 			   v4l2_kioctl          drv)
@@ -1218,64 +1193,64 @@ v4l_compat_translate_ioctl(struct inode         *inode,
 
 
 	switch (cmd) {
 	switch (cmd) {
 	case VIDIOCGCAP:	/* capability */
 	case VIDIOCGCAP:	/* capability */
-		err = v4l1_compat_get_capabilities(arg, inode, file, drv);
+		err = v4l1_compat_get_capabilities(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGFBUF: /*  get frame buffer  */
 	case VIDIOCGFBUF: /*  get frame buffer  */
-		err = v4l1_compat_get_frame_buffer(arg, inode, file, drv);
+		err = v4l1_compat_get_frame_buffer(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSFBUF: /*  set frame buffer  */
 	case VIDIOCSFBUF: /*  set frame buffer  */
-		err = v4l1_compat_set_frame_buffer(arg, inode, file, drv);
+		err = v4l1_compat_set_frame_buffer(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGWIN: /*  get window or capture dimensions  */
 	case VIDIOCGWIN: /*  get window or capture dimensions  */
-		err = v4l1_compat_get_win_cap_dimensions(arg, inode, file, drv);
+		err = v4l1_compat_get_win_cap_dimensions(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSWIN: /*  set window and/or capture dimensions  */
 	case VIDIOCSWIN: /*  set window and/or capture dimensions  */
-		err = v4l1_compat_set_win_cap_dimensions(arg, inode, file, drv);
+		err = v4l1_compat_set_win_cap_dimensions(arg, file, drv);
 		break;
 		break;
 	case VIDIOCCAPTURE: /*  turn on/off preview  */
 	case VIDIOCCAPTURE: /*  turn on/off preview  */
-		err = v4l1_compat_turn_preview_on_off(arg, inode, file, drv);
+		err = v4l1_compat_turn_preview_on_off(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGCHAN: /*  get input information  */
 	case VIDIOCGCHAN: /*  get input information  */
-		err = v4l1_compat_get_input_info(arg, inode, file, drv);
+		err = v4l1_compat_get_input_info(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSCHAN: /*  set input  */
 	case VIDIOCSCHAN: /*  set input  */
-		err = v4l1_compat_set_input(arg, inode, file, drv);
+		err = v4l1_compat_set_input(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGPICT: /*  get tone controls & partial capture format  */
 	case VIDIOCGPICT: /*  get tone controls & partial capture format  */
-		err = v4l1_compat_get_picture(arg, inode, file, drv);
+		err = v4l1_compat_get_picture(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSPICT: /*  set tone controls & partial capture format  */
 	case VIDIOCSPICT: /*  set tone controls & partial capture format  */
-		err = v4l1_compat_set_picture(arg, inode, file, drv);
+		err = v4l1_compat_set_picture(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGTUNER: /*  get tuner information  */
 	case VIDIOCGTUNER: /*  get tuner information  */
-		err = v4l1_compat_get_tuner(arg, inode, file, drv);
+		err = v4l1_compat_get_tuner(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSTUNER: /*  select a tuner input  */
 	case VIDIOCSTUNER: /*  select a tuner input  */
-		err = v4l1_compat_select_tuner(arg, inode, file, drv);
+		err = v4l1_compat_select_tuner(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGFREQ: /*  get frequency  */
 	case VIDIOCGFREQ: /*  get frequency  */
-		err = v4l1_compat_get_frequency(arg, inode, file, drv);
+		err = v4l1_compat_get_frequency(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSFREQ: /*  set frequency  */
 	case VIDIOCSFREQ: /*  set frequency  */
-		err = v4l1_compat_set_frequency(arg, inode, file, drv);
+		err = v4l1_compat_set_frequency(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGAUDIO: /*  get audio properties/controls  */
 	case VIDIOCGAUDIO: /*  get audio properties/controls  */
-		err = v4l1_compat_get_audio(arg, inode, file, drv);
+		err = v4l1_compat_get_audio(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSAUDIO: /*  set audio controls  */
 	case VIDIOCSAUDIO: /*  set audio controls  */
-		err = v4l1_compat_set_audio(arg, inode, file, drv);
+		err = v4l1_compat_set_audio(arg, file, drv);
 		break;
 		break;
 	case VIDIOCMCAPTURE: /*  capture a frame  */
 	case VIDIOCMCAPTURE: /*  capture a frame  */
-		err = v4l1_compat_capture_frame(arg, inode, file, drv);
+		err = v4l1_compat_capture_frame(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSYNC: /*  wait for a frame  */
 	case VIDIOCSYNC: /*  wait for a frame  */
-		err = v4l1_compat_sync(arg, inode, file, drv);
+		err = v4l1_compat_sync(arg, file, drv);
 		break;
 		break;
 	case VIDIOCGVBIFMT: /* query VBI data capture format */
 	case VIDIOCGVBIFMT: /* query VBI data capture format */
-		err = v4l1_compat_get_vbi_format(arg, inode, file, drv);
+		err = v4l1_compat_get_vbi_format(arg, file, drv);
 		break;
 		break;
 	case VIDIOCSVBIFMT:
 	case VIDIOCSVBIFMT:
-		err = v4l1_compat_set_vbi_format(arg, inode, file, drv);
+		err = v4l1_compat_set_vbi_format(arg, file, drv);
 		break;
 		break;
 	default:
 	default:
 		err = -ENOIOCTLCMD;
 		err = -ENOIOCTLCMD;

+ 4 - 1
drivers/media/video/v4l2-int-device.c

@@ -32,7 +32,7 @@
 static DEFINE_MUTEX(mutex);
 static DEFINE_MUTEX(mutex);
 static LIST_HEAD(int_list);
 static LIST_HEAD(int_list);
 
 
-static void v4l2_int_device_try_attach_all(void)
+void v4l2_int_device_try_attach_all(void)
 {
 {
 	struct v4l2_int_device *m, *s;
 	struct v4l2_int_device *m, *s;
 
 
@@ -66,6 +66,7 @@ static void v4l2_int_device_try_attach_all(void)
 		}
 		}
 	}
 	}
 }
 }
+EXPORT_SYMBOL_GPL(v4l2_int_device_try_attach_all);
 
 
 static int ioctl_sort_cmp(const void *a, const void *b)
 static int ioctl_sort_cmp(const void *a, const void *b)
 {
 {
@@ -144,6 +145,7 @@ int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd)
 		find_ioctl(d->u.slave, cmd,
 		find_ioctl(d->u.slave, cmd,
 			   (v4l2_int_ioctl_func *)no_such_ioctl_0))(d);
 			   (v4l2_int_ioctl_func *)no_such_ioctl_0))(d);
 }
 }
+EXPORT_SYMBOL_GPL(v4l2_int_ioctl_0);
 
 
 static int no_such_ioctl_1(struct v4l2_int_device *d, void *arg)
 static int no_such_ioctl_1(struct v4l2_int_device *d, void *arg)
 {
 {
@@ -156,5 +158,6 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg)
 		find_ioctl(d->u.slave, cmd,
 		find_ioctl(d->u.slave, cmd,
 			   (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg);
 			   (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg);
 }
 }
+EXPORT_SYMBOL_GPL(v4l2_int_ioctl_1);
 
 
 MODULE_LICENSE("GPL");
 MODULE_LICENSE("GPL");

+ 13 - 6
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)
 	return -EINVAL;
 	return -EINVAL;
 }
 }
 
 
-static int __video_do_ioctl(struct inode *inode, struct file *file,
+static int __video_do_ioctl(struct file *file,
 		unsigned int cmd, void *arg)
 		unsigned int cmd, void *arg)
 {
 {
 	struct video_device *vfd = video_devdata(file);
 	struct video_device *vfd = video_devdata(file);
 	const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
 	const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
-	void                 *fh = file->private_data;
-	int                  ret = -EINVAL;
+	void *fh = file->private_data;
+	int ret = -EINVAL;
 
 
 	if ((vfd->debug & V4L2_DEBUG_IOCTL) &&
 	if ((vfd->debug & V4L2_DEBUG_IOCTL) &&
 				!(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) {
 				!(vfd->debug & V4L2_DEBUG_IOCTL_ARG)) {
@@ -675,7 +675,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
 	 V4L2 ioctls.
 	 V4L2 ioctls.
 	 ********************************************************/
 	 ********************************************************/
 	if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE)
 	if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE)
-		return v4l_compat_translate_ioctl(inode, file, cmd, arg,
+		return v4l_compat_translate_ioctl(file, cmd, arg,
 						__video_do_ioctl);
 						__video_do_ioctl);
 #endif
 #endif
 
 
@@ -1768,7 +1768,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
 	return ret;
 	return ret;
 }
 }
 
 
-int video_ioctl2(struct inode *inode, struct file *file,
+int __video_ioctl2(struct file *file,
 	       unsigned int cmd, unsigned long arg)
 	       unsigned int cmd, unsigned long arg)
 {
 {
 	char	sbuf[128];
 	char	sbuf[128];
@@ -1832,7 +1832,7 @@ int video_ioctl2(struct inode *inode, struct file *file,
 	}
 	}
 
 
 	/* Handles IOCTL */
 	/* Handles IOCTL */
-	err = __video_do_ioctl(inode, file, cmd, parg);
+	err = __video_do_ioctl(file, cmd, parg);
 	if (err == -ENOIOCTLCMD)
 	if (err == -ENOIOCTLCMD)
 		err = -EINVAL;
 		err = -EINVAL;
 	if (is_ext_ctrl) {
 	if (is_ext_ctrl) {
@@ -1860,4 +1860,11 @@ out:
 	kfree(mbuf);
 	kfree(mbuf);
 	return err;
 	return err;
 }
 }
+EXPORT_SYMBOL(__video_ioctl2);
+
+int video_ioctl2(struct inode *inode, struct file *file,
+	       unsigned int cmd, unsigned long arg)
+{
+	return __video_ioctl2(file, cmd, arg);
+}
 EXPORT_SYMBOL(video_ioctl2);
 EXPORT_SYMBOL(video_ioctl2);

+ 29 - 23
drivers/media/video/videobuf-dvb.c

@@ -296,29 +296,7 @@ EXPORT_SYMBOL(videobuf_dvb_register_bus);
 
 
 void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f)
 void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f)
 {
 {
-	struct list_head *list, *q;
-	struct videobuf_dvb_frontend *fe;
-
-	mutex_lock(&f->lock);
-	list_for_each_safe(list, q, &f->felist) {
-		fe = list_entry(list, struct videobuf_dvb_frontend, felist);
-		if (fe->dvb.net.dvbdev) {
-			dvb_net_release(&fe->dvb.net);
-			fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
-				&fe->dvb.fe_mem);
-			fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
-				&fe->dvb.fe_hw);
-			dvb_dmxdev_release(&fe->dvb.dmxdev);
-			dvb_dmx_release(&fe->dvb.demux);
-			dvb_unregister_frontend(fe->dvb.frontend);
-		}
-		if (fe->dvb.frontend)
-			/* always allocated, may have been reset */
-			dvb_frontend_detach(fe->dvb.frontend);
-		list_del(list);
-		kfree(fe);
-	}
-	mutex_unlock(&f->lock);
+	videobuf_dvb_dealloc_frontends(f);
 
 
 	dvb_unregister_adapter(&f->adapter);
 	dvb_unregister_adapter(&f->adapter);
 }
 }
@@ -389,3 +367,31 @@ fail_alloc:
 	return fe;
 	return fe;
 }
 }
 EXPORT_SYMBOL(videobuf_dvb_alloc_frontend);
 EXPORT_SYMBOL(videobuf_dvb_alloc_frontend);
+
+void videobuf_dvb_dealloc_frontends(struct videobuf_dvb_frontends *f)
+{
+	struct list_head *list, *q;
+	struct videobuf_dvb_frontend *fe;
+
+	mutex_lock(&f->lock);
+	list_for_each_safe(list, q, &f->felist) {
+		fe = list_entry(list, struct videobuf_dvb_frontend, felist);
+		if (fe->dvb.net.dvbdev) {
+			dvb_net_release(&fe->dvb.net);
+			fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
+				&fe->dvb.fe_mem);
+			fe->dvb.demux.dmx.remove_frontend(&fe->dvb.demux.dmx,
+				&fe->dvb.fe_hw);
+			dvb_dmxdev_release(&fe->dvb.dmxdev);
+			dvb_dmx_release(&fe->dvb.demux);
+			dvb_unregister_frontend(fe->dvb.frontend);
+		}
+		if (fe->dvb.frontend)
+			/* always allocated, may have been reset */
+			dvb_frontend_detach(fe->dvb.frontend);
+		list_del(list); /* remove list entry */
+		kfree(fe);	/* free frontend allocation */
+	}
+	mutex_unlock(&f->lock);
+}
+EXPORT_SYMBOL(videobuf_dvb_dealloc_frontends);

+ 3 - 3
drivers/media/video/vivi.c

@@ -1163,11 +1163,11 @@ static int vivi_release(void)
 
 
 		if (-1 != dev->vfd->minor) {
 		if (-1 != dev->vfd->minor) {
 			printk(KERN_INFO "%s: unregistering /dev/video%d\n",
 			printk(KERN_INFO "%s: unregistering /dev/video%d\n",
-				VIVI_MODULE_NAME, dev->vfd->minor);
+				VIVI_MODULE_NAME, dev->vfd->num);
 			video_unregister_device(dev->vfd);
 			video_unregister_device(dev->vfd);
 		} else {
 		} else {
 			printk(KERN_INFO "%s: releasing /dev/video%d\n",
 			printk(KERN_INFO "%s: releasing /dev/video%d\n",
-				VIVI_MODULE_NAME, dev->vfd->minor);
+				VIVI_MODULE_NAME, dev->vfd->num);
 			video_device_release(dev->vfd);
 			video_device_release(dev->vfd);
 		}
 		}
 
 
@@ -1307,7 +1307,7 @@ static int __init vivi_init(void)
 
 
 		dev->vfd = vfd;
 		dev->vfd = vfd;
 		printk(KERN_INFO "%s: V4L2 device registered as /dev/video%d\n",
 		printk(KERN_INFO "%s: V4L2 device registered as /dev/video%d\n",
-			VIVI_MODULE_NAME, vfd->minor);
+			VIVI_MODULE_NAME, vfd->num);
 	}
 	}
 
 
 	if (ret < 0) {
 	if (ret < 0) {

+ 8 - 8
drivers/media/video/w9968cf.c

@@ -2398,7 +2398,7 @@ error:
 	cam->sensor = CC_UNKNOWN;
 	cam->sensor = CC_UNKNOWN;
 	DBG(1, "Image sensor initialization failed for %s (/dev/video%d). "
 	DBG(1, "Image sensor initialization failed for %s (/dev/video%d). "
 	       "Try to detach and attach this device again",
 	       "Try to detach and attach this device again",
-	    symbolic(camlist, cam->id), cam->v4ldev->minor)
+	    symbolic(camlist, cam->id), cam->v4ldev->num)
 	return err;
 	return err;
 }
 }
 
 
@@ -2644,7 +2644,7 @@ static void w9968cf_release_resources(struct w9968cf_device* cam)
 {
 {
 	mutex_lock(&w9968cf_devlist_mutex);
 	mutex_lock(&w9968cf_devlist_mutex);
 
 
-	DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->minor)
+	DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->num)
 
 
 	video_unregister_device(cam->v4ldev);
 	video_unregister_device(cam->v4ldev);
 	list_del(&cam->v4llist);
 	list_del(&cam->v4llist);
@@ -2679,7 +2679,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
 		DBG(2, "No supported image sensor has been detected by the "
 		DBG(2, "No supported image sensor has been detected by the "
 		       "'ovcamchip' module for the %s (/dev/video%d). Make "
 		       "'ovcamchip' module for the %s (/dev/video%d). Make "
 		       "sure it is loaded *before* (re)connecting the camera.",
 		       "sure it is loaded *before* (re)connecting the camera.",
-		    symbolic(camlist, cam->id), cam->v4ldev->minor)
+		    symbolic(camlist, cam->id), cam->v4ldev->num)
 		mutex_unlock(&cam->dev_mutex);
 		mutex_unlock(&cam->dev_mutex);
 		up_read(&w9968cf_disconnect);
 		up_read(&w9968cf_disconnect);
 		return -ENODEV;
 		return -ENODEV;
@@ -2687,7 +2687,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
 
 
 	if (cam->users) {
 	if (cam->users) {
 		DBG(2, "%s (/dev/video%d) has been already occupied by '%s'",
 		DBG(2, "%s (/dev/video%d) has been already occupied by '%s'",
-		    symbolic(camlist, cam->id),cam->v4ldev->minor,cam->command)
+		    symbolic(camlist, cam->id), cam->v4ldev->num, cam->command)
 		if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) {
 		if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) {
 			mutex_unlock(&cam->dev_mutex);
 			mutex_unlock(&cam->dev_mutex);
 			up_read(&w9968cf_disconnect);
 			up_read(&w9968cf_disconnect);
@@ -2709,7 +2709,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
 	}
 	}
 
 
 	DBG(5, "Opening '%s', /dev/video%d ...",
 	DBG(5, "Opening '%s', /dev/video%d ...",
-	    symbolic(camlist, cam->id), cam->v4ldev->minor)
+	    symbolic(camlist, cam->id), cam->v4ldev->num)
 
 
 	cam->streaming = 0;
 	cam->streaming = 0;
 	cam->misconfigured = 0;
 	cam->misconfigured = 0;
@@ -2947,7 +2947,7 @@ static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 			.minheight = cam->minheight,
 			.minheight = cam->minheight,
 		};
 		};
 		sprintf(cap.name, "W996[87]CF USB Camera #%d",
 		sprintf(cap.name, "W996[87]CF USB Camera #%d",
-			cam->v4ldev->minor);
+			cam->v4ldev->num);
 		cap.maxwidth = (cam->upscaling && w9968cf_vpp)
 		cap.maxwidth = (cam->upscaling && w9968cf_vpp)
 			       ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth)
 			       ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth)
 				 : cam->maxwidth;
 				 : cam->maxwidth;
@@ -3567,7 +3567,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 		goto fail;
 		goto fail;
 	}
 	}
 
 
-	DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev->minor)
+	DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev->num)
 
 
 	/* Set some basic constants */
 	/* Set some basic constants */
 	w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
 	w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
@@ -3618,7 +3618,7 @@ static void w9968cf_usb_disconnect(struct usb_interface* intf)
 			DBG(2, "The device is open (/dev/video%d)! "
 			DBG(2, "The device is open (/dev/video%d)! "
 			       "Process name: %s. Deregistration and memory "
 			       "Process name: %s. Deregistration and memory "
 			       "deallocation are deferred on close.",
 			       "deallocation are deferred on close.",
-			    cam->v4ldev->minor, cam->command)
+			    cam->v4ldev->num, cam->command)
 			cam->misconfigured = 1;
 			cam->misconfigured = 1;
 			w9968cf_stop_transfer(cam);
 			w9968cf_stop_transfer(cam);
 			wake_up_interruptible(&cam->wait_queue);
 			wake_up_interruptible(&cam->wait_queue);

+ 12 - 12
drivers/media/video/zc0301/zc0301_core.c

@@ -539,7 +539,7 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "URB timeout reached. The camera is misconfigured. To "
 		DBG(1, "URB timeout reached. The camera is misconfigured. To "
 		       "use it, close and open /dev/video%d again.",
 		       "use it, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -640,7 +640,7 @@ static void zc0301_release_resources(struct kref *kref)
 {
 {
 	struct zc0301_device *cam = container_of(kref, struct zc0301_device,
 	struct zc0301_device *cam = container_of(kref, struct zc0301_device,
 						 kref);
 						 kref);
-	DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor);
+	DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_set_drvdata(cam->v4ldev, NULL);
 	video_unregister_device(cam->v4ldev);
 	video_unregister_device(cam->v4ldev);
 	usb_put_dev(cam->usbdev);
 	usb_put_dev(cam->usbdev);
@@ -679,7 +679,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
 	}
 	}
 
 
 	if (cam->users) {
 	if (cam->users) {
-		DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->minor);
+		DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->num);
 		DBG(3, "Simultaneous opens are not supported");
 		DBG(3, "Simultaneous opens are not supported");
 		if ((filp->f_flags & O_NONBLOCK) ||
 		if ((filp->f_flags & O_NONBLOCK) ||
 		    (filp->f_flags & O_NDELAY)) {
 		    (filp->f_flags & O_NDELAY)) {
@@ -722,7 +722,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
 	cam->frame_count = 0;
 	cam->frame_count = 0;
 	zc0301_empty_framequeues(cam);
 	zc0301_empty_framequeues(cam);
 
 
-	DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor);
+	DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
 
 
 out:
 out:
 	mutex_unlock(&cam->open_mutex);
 	mutex_unlock(&cam->open_mutex);
@@ -746,7 +746,7 @@ static int zc0301_release(struct inode* inode, struct file* filp)
 	cam->users--;
 	cam->users--;
 	wake_up_interruptible_nr(&cam->wait_open, 1);
 	wake_up_interruptible_nr(&cam->wait_open, 1);
 
 
-	DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor);
+	DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
 
 
 	kref_put(&cam->kref, zc0301_release_resources);
 	kref_put(&cam->kref, zc0301_release_resources);
 
 
@@ -1275,7 +1275,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
 		DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -1288,7 +1288,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
 		DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 
 
@@ -1470,7 +1470,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
 		DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -1482,7 +1482,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
 		DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
 		       "use the camera, close and open /dev/video%d again.",
 		       "use the camera, close and open /dev/video%d again.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
 
 
@@ -1529,7 +1529,7 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_device* cam, void __user * arg)
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
 		DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
 		       "problems. To use the camera, close and open "
 		       "problems. To use the camera, close and open "
-		       "/dev/video%d again.", cam->v4ldev->minor);
+		       "/dev/video%d again.", cam->v4ldev->num);
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
@@ -2005,7 +2005,7 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 		goto fail;
 		goto fail;
 	}
 	}
 
 
-	DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
+	DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
 
 
 	cam->module_param.force_munmap = force_munmap[dev_nr];
 	cam->module_param.force_munmap = force_munmap[dev_nr];
 	cam->module_param.frame_timeout = frame_timeout[dev_nr];
 	cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2044,7 +2044,7 @@ static void zc0301_usb_disconnect(struct usb_interface* intf)
 	if (cam->users) {
 	if (cam->users) {
 		DBG(2, "Device /dev/video%d is open! Deregistration and "
 		DBG(2, "Device /dev/video%d is open! Deregistration and "
 		       "memory deallocation are deferred.",
 		       "memory deallocation are deferred.",
-		    cam->v4ldev->minor);
+		    cam->v4ldev->num);
 		cam->state |= DEV_MISCONFIGURED;
 		cam->state |= DEV_MISCONFIGURED;
 		zc0301_stop_transfer(cam);
 		zc0301_stop_transfer(cam);
 		cam->state |= DEV_DISCONNECTED;
 		cam->state |= DEV_DISCONNECTED;

+ 1 - 1
drivers/media/video/zr364xx.c

@@ -885,7 +885,7 @@ static int zr364xx_probe(struct usb_interface *intf,
 	usb_set_intfdata(intf, cam);
 	usb_set_intfdata(intf, cam);
 
 
 	dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n",
 	dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n",
-		 cam->vdev->minor);
+		 cam->vdev->num);
 	return 0;
 	return 0;
 }
 }
 
 

+ 7 - 0
include/linux/videodev2.h

@@ -315,6 +315,13 @@ struct v4l2_pix_format {
 /* see http://www.siliconimaging.com/RGB%20Bayer.htm */
 /* see http://www.siliconimaging.com/RGB%20Bayer.htm */
 #define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
 #define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
 #define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
 #define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
+/*
+ * 10bit raw bayer, expanded to 16 bits
+ * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
+ */
+#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0')
+/* 10bit raw bayer DPCM compressed to 8 bits */
+#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
 #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. GRGR.. */
 #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. GRGR.. */
 
 
 /* compressed formats */
 /* compressed formats */

+ 26 - 2
include/media/v4l2-int-device.h

@@ -84,6 +84,8 @@ struct v4l2_int_device {
 	void *priv;
 	void *priv;
 };
 };
 
 
+void v4l2_int_device_try_attach_all(void);
+
 int v4l2_int_device_register(struct v4l2_int_device *d);
 int v4l2_int_device_register(struct v4l2_int_device *d);
 void v4l2_int_device_unregister(struct v4l2_int_device *d);
 void v4l2_int_device_unregister(struct v4l2_int_device *d);
 
 
@@ -96,6 +98,12 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg);
  *
  *
  */
  */
 
 
+enum v4l2_power {
+	V4L2_POWER_OFF = 0,
+	V4L2_POWER_ON,
+	V4L2_POWER_STANDBY,
+};
+
 /* Slave interface type. */
 /* Slave interface type. */
 enum v4l2_if_type {
 enum v4l2_if_type {
 	/*
 	/*
@@ -170,6 +178,9 @@ enum v4l2_int_ioctl_num {
 	vidioc_int_queryctrl_num,
 	vidioc_int_queryctrl_num,
 	vidioc_int_g_ctrl_num,
 	vidioc_int_g_ctrl_num,
 	vidioc_int_s_ctrl_num,
 	vidioc_int_s_ctrl_num,
+	vidioc_int_cropcap_num,
+	vidioc_int_g_crop_num,
+	vidioc_int_s_crop_num,
 	vidioc_int_g_parm_num,
 	vidioc_int_g_parm_num,
 	vidioc_int_s_parm_num,
 	vidioc_int_s_parm_num,
 
 
@@ -182,12 +193,19 @@ enum v4l2_int_ioctl_num {
 	vidioc_int_dev_init_num = 1000,
 	vidioc_int_dev_init_num = 1000,
 	/* Delinitialise the device at slave detach. */
 	/* Delinitialise the device at slave detach. */
 	vidioc_int_dev_exit_num,
 	vidioc_int_dev_exit_num,
-	/* Set device power state: 0 is off, non-zero is on. */
+	/* Set device power state. */
 	vidioc_int_s_power_num,
 	vidioc_int_s_power_num,
+	/*
+	* Get slave private data, e.g. platform-specific slave
+	* configuration used by the master.
+	*/
+	vidioc_int_g_priv_num,
 	/* Get slave interface parameters. */
 	/* Get slave interface parameters. */
 	vidioc_int_g_ifparm_num,
 	vidioc_int_g_ifparm_num,
 	/* Does the slave need to be reset after VIDIOC_DQBUF? */
 	/* Does the slave need to be reset after VIDIOC_DQBUF? */
 	vidioc_int_g_needs_reset_num,
 	vidioc_int_g_needs_reset_num,
+	vidioc_int_enum_framesizes_num,
+	vidioc_int_enum_frameintervals_num,
 
 
 	/*
 	/*
 	 *
 	 *
@@ -261,14 +279,20 @@ V4L2_INT_WRAPPER_1(try_fmt_cap, struct v4l2_format, *);
 V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *);
 V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *);
 V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *);
 V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *);
 V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *);
 V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *);
+V4L2_INT_WRAPPER_1(cropcap, struct v4l2_cropcap, *);
+V4L2_INT_WRAPPER_1(g_crop, struct v4l2_crop, *);
+V4L2_INT_WRAPPER_1(s_crop, struct v4l2_crop, *);
 V4L2_INT_WRAPPER_1(g_parm, struct v4l2_streamparm, *);
 V4L2_INT_WRAPPER_1(g_parm, struct v4l2_streamparm, *);
 V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *);
 V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *);
 
 
 V4L2_INT_WRAPPER_0(dev_init);
 V4L2_INT_WRAPPER_0(dev_init);
 V4L2_INT_WRAPPER_0(dev_exit);
 V4L2_INT_WRAPPER_0(dev_exit);
-V4L2_INT_WRAPPER_1(s_power, int, );
+V4L2_INT_WRAPPER_1(s_power, enum v4l2_power, );
+V4L2_INT_WRAPPER_1(g_priv, void, *);
 V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *);
 V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *);
 V4L2_INT_WRAPPER_1(g_needs_reset, void, *);
 V4L2_INT_WRAPPER_1(g_needs_reset, void, *);
+V4L2_INT_WRAPPER_1(enum_framesizes, struct v4l2_frmsizeenum, *);
+V4L2_INT_WRAPPER_1(enum_frameintervals, struct v4l2_frmivalenum, *);
 
 
 V4L2_INT_WRAPPER_0(reset);
 V4L2_INT_WRAPPER_0(reset);
 V4L2_INT_WRAPPER_0(init);
 V4L2_INT_WRAPPER_0(init);

+ 18 - 6
include/media/v4l2-ioctl.h

@@ -271,26 +271,38 @@ extern const char *v4l2_field_names[];
 extern const char *v4l2_type_names[];
 extern const char *v4l2_type_names[];
 
 
 /*  Compatibility layer interface  --  v4l1-compat module */
 /*  Compatibility layer interface  --  v4l1-compat module */
-typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,
+typedef int (*v4l2_kioctl)(struct file *file,
 			   unsigned int cmd, void *arg);
 			   unsigned int cmd, void *arg);
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
-int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,
+int v4l_compat_translate_ioctl(struct file *file,
 			       int cmd, void *arg, v4l2_kioctl driver_ioctl);
 			       int cmd, void *arg, v4l2_kioctl driver_ioctl);
 #else
 #else
-#define v4l_compat_translate_ioctl(inode, file, cmd, arg, ioctl) (-EINVAL)
+#define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL)
 #endif
 #endif
 
 
 /* 32 Bits compatibility layer for 64 bits processors */
 /* 32 Bits compatibility layer for 64 bits processors */
 extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
 extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
 				unsigned long arg);
 				unsigned long arg);
 
 
-extern int video_ioctl2(struct inode *inode, struct file *file,
-			  unsigned int cmd, unsigned long arg);
-
 /* Include support for obsoleted stuff */
 /* Include support for obsoleted stuff */
 extern int video_usercopy(struct inode *inode, struct file *file,
 extern int video_usercopy(struct inode *inode, struct file *file,
 			  unsigned int cmd, unsigned long arg,
 			  unsigned int cmd, unsigned long arg,
 			  int (*func)(struct inode *inode, struct file *file,
 			  int (*func)(struct inode *inode, struct file *file,
 				      unsigned int cmd, void *arg));
 				      unsigned int cmd, void *arg));
 
 
+/* Standard handlers for V4L ioctl's */
+
+/* This prototype is used on fops.unlocked_ioctl */
+extern int __video_ioctl2(struct file *file,
+			unsigned int cmd, unsigned long arg);
+
+/* This prototype is used on fops.ioctl
+ * Since fops.ioctl enables Kernel Big Lock, it is preferred
+ * to use __video_ioctl2 instead.
+ * It should be noticed that there's no lock code inside
+ * video_ioctl2().
+ */
+extern int video_ioctl2(struct inode *inode, struct file *file,
+			unsigned int cmd, unsigned long arg);
+
 #endif /* _V4L2_IOCTL_H */
 #endif /* _V4L2_IOCTL_H */

+ 1 - 0
include/media/videobuf-dvb.h

@@ -47,6 +47,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
 void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);
 void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);
 
 
 struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id);
 struct videobuf_dvb_frontend * videobuf_dvb_alloc_frontend(struct videobuf_dvb_frontends *f, int id);
+void videobuf_dvb_dealloc_frontends(struct videobuf_dvb_frontends *f);
 
 
 struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id);
 struct videobuf_dvb_frontend * videobuf_dvb_get_frontend(struct videobuf_dvb_frontends *f, int id);
 int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p);
 int videobuf_dvb_find_frontend(struct videobuf_dvb_frontends *f, struct dvb_frontend *p);