Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1a6ee74 authored by Nicola Soranzo's avatar Nicola Soranzo Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (10525): em28xx: Coding style fixes and a typo correction



Lots of coding style fixes and a typo correction for em28xx.

[dougsland@redhat.com: fixed a reject due to a change on em28xx-audio.c]
Signed-off-by: default avatarNicola Soranzo <nsoranzo@tiscali.it>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7aa0eabd
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
{
	struct snd_pcm_runtime *runtime = subs->runtime;

	dprintk("Alocating vbuffer\n");
	dprintk("Allocating vbuffer\n");
	if (runtime->dma_area) {
		if (runtime->dma_bytes > size)
			return 0;
@@ -410,7 +410,6 @@ static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream
						    *substream)
{
	unsigned long flags;

	struct em28xx *dev;
	snd_pcm_uframes_t hwptr_done;

+13 −11
Original line number Diff line number Diff line
@@ -1217,7 +1217,9 @@ struct em28xx_board em28xx_boards[] = {
		.has_dvb      = 1,
		.dvb_gpio     = kworld_330u_digital,
		.xclk             = EM28XX_XCLK_FREQUENCY_12MHZ,
		.i2c_speed        = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_EEPROM_ON_BOARD | EM28XX_I2C_EEPROM_KEY_VALID,
		.i2c_speed        = EM28XX_I2C_CLK_WAIT_ENABLE |
				    EM28XX_I2C_EEPROM_ON_BOARD |
				    EM28XX_I2C_EEPROM_KEY_VALID,
		.input        = { {
			.type     = EM28XX_VMUX_TELEVISION,
			.vmux     = TVP5150_COMPOSITE0,
@@ -1433,7 +1435,7 @@ int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
}
EXPORT_SYMBOL_GPL(em28xx_tuner_callback);

static void inline em28xx_set_model(struct em28xx *dev)
static inline void em28xx_set_model(struct em28xx *dev)
{
	memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board));

+10 −9
Original line number Diff line number Diff line
@@ -462,7 +462,8 @@ int em28xx_audio_analog_set(struct em28xx *dev)
		if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) {
			int sel = ac97_return_record_select(dev->ctl_aoutput);

			/* Use the same input for both left and right channels */
			/* Use the same input for both left and right
			   channels */
			sel |= (sel << 8);

			em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel);
+4 −2
Original line number Diff line number Diff line
@@ -402,10 +402,12 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len)
				 dev->name);
		break;
	case 2:
		printk(KERN_INFO "%s:\tI2S audio, sample rate=32k\n", dev->name);
		printk(KERN_INFO "%s:\tI2S audio, sample rate=32k\n",
				 dev->name);
		break;
	case 3:
		printk(KERN_INFO "%s:\tI2S audio, 3 sample rates\n", dev->name);
		printk(KERN_INFO "%s:\tI2S audio, 3 sample rates\n",
				 dev->name);
		break;
	}

+25 −18
Original line number Diff line number Diff line
@@ -186,7 +186,8 @@ static void em28xx_copy_video(struct em28xx *dev,
		em28xx_isocdbg("Overflow of %zi bytes past buffer end (1)\n",
			       ((char *)startwrite + lencopy) -
			       ((char *)outp + buf->vb.size));
		lencopy = remain = (char *)outp + buf->vb.size - (char *)startwrite;
		remain = (char *)outp + buf->vb.size - (char *)startwrite;
		lencopy = remain;
	}
	if (lencopy <= 0)
		return;
@@ -202,7 +203,8 @@ static void em28xx_copy_video(struct em28xx *dev,
		else
			lencopy = bytesperline;

		if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) {
		if ((char *)startwrite + lencopy > (char *)outp +
		    buf->vb.size) {
			em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n",
				       ((char *)startwrite + lencopy) -
				       ((char *)outp + buf->vb.size));
@@ -476,7 +478,9 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
static void
buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
{
	struct em28xx_buffer    *buf     = container_of(vb, struct em28xx_buffer, vb);
	struct em28xx_buffer    *buf     = container_of(vb,
							struct em28xx_buffer,
							vb);
	struct em28xx_fh        *fh      = vq->priv_data;
	struct em28xx           *dev     = fh->dev;
	struct em28xx_dmaqueue  *vidq    = &dev->vidq;
@@ -489,7 +493,9 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
static void buffer_release(struct videobuf_queue *vq,
				struct videobuf_buffer *vb)
{
	struct em28xx_buffer   *buf  = container_of(vb, struct em28xx_buffer, vb);
	struct em28xx_buffer   *buf  = container_of(vb,
						    struct em28xx_buffer,
						    vb);
	struct em28xx_fh       *fh   = vq->priv_data;
	struct em28xx          *dev  = (struct em28xx *)fh->dev;

@@ -557,7 +563,7 @@ static int res_get(struct em28xx_fh *fh)

static int res_check(struct em28xx_fh *fh)
{
	return (fh->stream_on);
	return fh->stream_on;
}

static void res_free(struct em28xx_fh *fh)
@@ -1436,7 +1442,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
	if (rc < 0)
		return rc;

	return (videobuf_reqbufs(&fh->vb_vidq, rb));
	return videobuf_reqbufs(&fh->vb_vidq, rb);
}

static int vidioc_querybuf(struct file *file, void *priv,
@@ -1450,7 +1456,7 @@ static int vidioc_querybuf(struct file *file, void *priv,
	if (rc < 0)
		return rc;

	return (videobuf_querybuf(&fh->vb_vidq, b));
	return videobuf_querybuf(&fh->vb_vidq, b);
}

static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
@@ -1463,7 +1469,7 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
	if (rc < 0)
		return rc;

	return (videobuf_qbuf(&fh->vb_vidq, b));
	return videobuf_qbuf(&fh->vb_vidq, b);
}

static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
@@ -1476,8 +1482,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
	if (rc < 0)
		return rc;

	return (videobuf_dqbuf(&fh->vb_vidq, b,
				file->f_flags & O_NONBLOCK));
	return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK);
}

#ifdef CONFIG_VIDEO_V4L1_COMPAT
@@ -1990,7 +1995,8 @@ int em28xx_register_analog_devices(struct em28xx *dev)

/*	em28xx_write_reg(dev, EM28XX_R0E_AUDIOSRC, 0xc0); audio register */
	val = (u8)em28xx_read_reg(dev, EM28XX_R0F_XCLK);
       em28xx_write_reg(dev, EM28XX_R0F_XCLK, (EM28XX_XCLK_AUDIO_UNMUTE | val));
	em28xx_write_reg(dev, EM28XX_R0F_XCLK,
			 (EM28XX_XCLK_AUDIO_UNMUTE | val));
	em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x51);

	em28xx_set_outfmt(dev);
@@ -2025,7 +2031,8 @@ int em28xx_register_analog_devices(struct em28xx *dev)
	}

	if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) {
		dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, "radio");
		dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template,
						  "radio");
		if (!dev->radio_dev) {
			em28xx_errdev("cannot allocate video_device.\n");
			return -ENODEV;
Loading