Commit ed7c221c authored by Curtis McEnroe's avatar Curtis McEnroe Committed by Greg Kroah-Hartman

staging: tm6000: cleaned up code in tm6000-video.c according to coding style

Fixed all errors reported by the checker in tm6000-video.c mostly relating
to whitespace.
Signed-off-by: default avatarCurtis McEnroe <programble@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2d32f746
...@@ -777,7 +777,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, ...@@ -777,7 +777,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
} }
if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
if (0 != (rc = videobuf_iolock(vq, &buf->vb, NULL))) rc = videobuf_iolock(vq, &buf->vb, NULL);
if (rc != 0)
goto fail; goto fail;
urb_init = 1; urb_init = 1;
} }
...@@ -1048,12 +1049,12 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) ...@@ -1048,12 +1049,12 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
if (!res_get(dev, fh, false)) if (!res_get(dev, fh, false))
return -EBUSY; return -EBUSY;
return (videobuf_streamon(&fh->vb_vidq)); return videobuf_streamon(&fh->vb_vidq);
} }
static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
{ {
struct tm6000_fh *fh=priv; struct tm6000_fh *fh = priv;
struct tm6000_core *dev = fh->dev; struct tm6000_core *dev = fh->dev;
if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
...@@ -1062,15 +1063,15 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) ...@@ -1062,15 +1063,15 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
return -EINVAL; return -EINVAL;
videobuf_streamoff(&fh->vb_vidq); videobuf_streamoff(&fh->vb_vidq);
res_free(dev,fh); res_free(dev, fh);
return (0); return 0;
} }
static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *norm) static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
{ {
int rc=0; int rc = 0;
struct tm6000_fh *fh=priv; struct tm6000_fh *fh = priv;
struct tm6000_core *dev = fh->dev; struct tm6000_core *dev = fh->dev;
dev->norm = *norm; dev->norm = *norm;
...@@ -1079,7 +1080,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *norm) ...@@ -1079,7 +1080,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *norm)
fh->width = dev->width; fh->width = dev->width;
fh->height = dev->height; fh->height = dev->height;
if (rc<0) if (rc < 0)
return rc; return rc;
v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, dev->norm); v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_std, dev->norm);
...@@ -1087,7 +1088,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *norm) ...@@ -1087,7 +1088,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *norm)
return 0; return 0;
} }
static const char *iname [] = { static const char *iname[] = {
[TM6000_INPUT_TV] = "Television", [TM6000_INPUT_TV] = "Television",
[TM6000_INPUT_COMPOSITE1] = "Composite 1", [TM6000_INPUT_COMPOSITE1] = "Composite 1",
[TM6000_INPUT_COMPOSITE2] = "Composite 2", [TM6000_INPUT_COMPOSITE2] = "Composite 2",
...@@ -1394,10 +1395,10 @@ static int radio_g_input(struct file *filp, void *priv, unsigned int *i) ...@@ -1394,10 +1395,10 @@ static int radio_g_input(struct file *filp, void *priv, unsigned int *i)
struct tm6000_fh *fh = priv; struct tm6000_fh *fh = priv;
struct tm6000_core *dev = fh->dev; struct tm6000_core *dev = fh->dev;
if (dev->input !=5) if (dev->input != 5)
return -EINVAL; return -EINVAL;
*i = dev->input -5; *i = dev->input - 5;
return 0; return 0;
} }
...@@ -1508,18 +1509,18 @@ static int tm6000_open(struct file *file) ...@@ -1508,18 +1509,18 @@ static int tm6000_open(struct file *file)
fh->fmt = format_by_fourcc(dev->fourcc); fh->fmt = format_by_fourcc(dev->fourcc);
tm6000_get_std_res (dev); tm6000_get_std_res(dev);
fh->width = dev->width; fh->width = dev->width;
fh->height = dev->height; fh->height = dev->height;
dprintk(dev, V4L2_DEBUG_OPEN, "Open: fh=0x%08lx, dev=0x%08lx, " dprintk(dev, V4L2_DEBUG_OPEN, "Open: fh=0x%08lx, dev=0x%08lx, "
"dev->vidq=0x%08lx\n", "dev->vidq=0x%08lx\n",
(unsigned long)fh,(unsigned long)dev,(unsigned long)&dev->vidq); (unsigned long)fh, (unsigned long)dev, (unsigned long)&dev->vidq);
dprintk(dev, V4L2_DEBUG_OPEN, "Open: list_empty " dprintk(dev, V4L2_DEBUG_OPEN, "Open: list_empty "
"queued=%d\n",list_empty(&dev->vidq.queued)); "queued=%d\n", list_empty(&dev->vidq.queued));
dprintk(dev, V4L2_DEBUG_OPEN, "Open: list_empty " dprintk(dev, V4L2_DEBUG_OPEN, "Open: list_empty "
"active=%d\n",list_empty(&dev->vidq.active)); "active=%d\n", list_empty(&dev->vidq.active));
/* initialize hardware on analog mode */ /* initialize hardware on analog mode */
rc = tm6000_init_analog_mode(dev); rc = tm6000_init_analog_mode(dev);
...@@ -1557,7 +1558,7 @@ tm6000_read(struct file *file, char __user *data, size_t count, loff_t *pos) ...@@ -1557,7 +1558,7 @@ tm6000_read(struct file *file, char __user *data, size_t count, loff_t *pos)
{ {
struct tm6000_fh *fh = file->private_data; struct tm6000_fh *fh = file->private_data;
if (fh->type==V4L2_BUF_TYPE_VIDEO_CAPTURE) { if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
if (!res_get(fh->dev, fh, true)) if (!res_get(fh->dev, fh, true))
return -EBUSY; return -EBUSY;
...@@ -1583,7 +1584,7 @@ tm6000_poll(struct file *file, struct poll_table_struct *wait) ...@@ -1583,7 +1584,7 @@ tm6000_poll(struct file *file, struct poll_table_struct *wait)
/* streaming capture */ /* streaming capture */
if (list_empty(&fh->vb_vidq.stream)) if (list_empty(&fh->vb_vidq.stream))
return POLLERR; return POLLERR;
buf = list_entry(fh->vb_vidq.stream.next,struct tm6000_buffer,vb.stream); buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream);
} else { } else {
/* read() capture */ /* read() capture */
return videobuf_poll_stream(file, &fh->vb_vidq, return videobuf_poll_stream(file, &fh->vb_vidq,
...@@ -1699,7 +1700,7 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = { ...@@ -1699,7 +1700,7 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = {
struct video_device tm6000_radio_template = { struct video_device tm6000_radio_template = {
.name = "tm6000", .name = "tm6000",
.fops = &radio_fops, .fops = &radio_fops,
.ioctl_ops = &radio_ioctl_ops, .ioctl_ops = &radio_ioctl_ops,
}; };
/* ----------------------------------------------------------------- /* -----------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment