summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-15 14:07:18 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-15 14:07:18 -0300
commit6c7152d8e7cab73ccc06346104d485dd0c03aa19 (patch)
treef95cd34ea2a2c9f32ca15e8c0d559e52535af16f
parent3ed49e67d21dc68e7045fea44d8d3c1df96e85db (diff)
parent66e1098316efb51f63ab866e3d65034014bf3864 (diff)
downloadmediapointer-dvb-s2-6c7152d8e7cab73ccc06346104d485dd0c03aa19.tar.gz
mediapointer-dvb-s2-6c7152d8e7cab73ccc06346104d485dd0c03aa19.tar.bz2
merge: http://kernellabs.com/hg/~dheitmueller/em28xx-vbi-codingstyle/
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-vbi.c17
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c43
2 files changed, 28 insertions, 32 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-vbi.c b/linux/drivers/media/video/em28xx/em28xx-vbi.c
index 27d7e860f..94943e5a1 100644
--- a/linux/drivers/media/video/em28xx/em28xx-vbi.c
+++ b/linux/drivers/media/video/em28xx/em28xx-vbi.c
@@ -29,14 +29,14 @@
#include "em28xx.h"
static unsigned int vbibufs = 5;
-module_param(vbibufs,int,0644);
-MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32");
+module_param(vbibufs, int, 0644);
+MODULE_PARM_DESC(vbibufs, "number of vbi buffers, range 2-32");
static unsigned int vbi_debug;
-module_param(vbi_debug,int,0644);
-MODULE_PARM_DESC(vbi_debug,"enable debug messages [vbi]");
+module_param(vbi_debug, int, 0644);
+MODULE_PARM_DESC(vbi_debug, "enable debug messages [vbi]");
-#define dprintk(level,fmt, arg...) if (vbi_debug >= level) \
+#define dprintk(level, fmt, arg...) if (vbi_debug >= level) \
printk(KERN_DEBUG "%s: " fmt, dev->core->name , ## arg)
/* ------------------------------------------------------------------ */
@@ -140,10 +140,3 @@ struct videobuf_queue_ops em28xx_vbi_qops = {
.buf_queue = vbi_queue,
.buf_release = vbi_release,
};
-
-/* ------------------------------------------------------------------ */
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index bfe57ca82..edfe795ef 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -274,7 +274,8 @@ static void em28xx_copy_video(struct em28xx *dev,
if ((char *)startwrite + lencopy > (char *)outp +
buf->vb.size) {
- em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n",
+ em28xx_isocdbg("Overflow of %zi bytes past buffer end"
+ "(2)\n",
((char *)startwrite + lencopy) -
((char *)outp + buf->vb.size));
lencopy = remain = (char *)outp + buf->vb.size -
@@ -302,27 +303,27 @@ static void em28xx_copy_vbi(struct em28xx *dev,
int bytesperline = 720;
if (dev == NULL) {
- printk("dev is null\n");
+ em28xx_isocdbg("dev is null\n");
return;
}
if (dma_q == NULL) {
- printk("dma_q is null\n");
+ em28xx_isocdbg("dma_q is null\n");
return;
}
if (buf == NULL) {
#if 0
/* Disable by default - too chatty */
- printk("buf is null\n");
+ em28xx_isocdbg("buf is null\n");
#endif
return;
}
if (p == NULL) {
- printk("p is null\n");
+ em28xx_isocdbg("p is null\n");
return;
}
if (outp == NULL) {
- printk("outp is null\n");
+ em28xx_isocdbg("outp is null\n");
return;
}
@@ -614,7 +615,7 @@ static inline int em28xx_isoc_copy_vbi(struct em28xx *dev, struct urb *urb)
if (dev->vbi_read >= vbi_size) {
/* We've already read all the VBI data, so
treat the rest as video */
- printk("djh c should never happen\n");
+ em28xx_isocdbg("dev->vbi_read > vbi_size\n");
} else if ((dev->vbi_read + len) < vbi_size) {
/* This entire frame is VBI data */
if (dev->vbi_read == 0 &&
@@ -627,9 +628,9 @@ static inline int em28xx_isoc_copy_vbi(struct em28xx *dev, struct urb *urb)
vbi_get_next_buf(vbi_dma_q, &vbi_buf);
if (vbi_buf == NULL)
vbioutp = NULL;
- else {
- vbioutp = videobuf_to_vmalloc(&vbi_buf->vb);
- }
+ else
+ vbioutp = videobuf_to_vmalloc(
+ &vbi_buf->vb);
}
if (dev->vbi_read == 0) {
@@ -699,7 +700,8 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
struct em28xx *dev = fh->dev;
struct v4l2_frequency f;
- *size = (fh->dev->width * fh->dev->height * dev->format->depth + 7) >> 3;
+ *size = (fh->dev->width * fh->dev->height * dev->format->depth + 7)
+ >> 3;
if (0 == *count)
*count = EM28XX_DEF_BUF;
@@ -753,7 +755,8 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
struct em28xx *dev = fh->dev;
int rc = 0, urb_init = 0;
- buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth + 7) >> 3;
+ buf->vb.size = (fh->dev->width * fh->dev->height * dev->format->depth
+ + 7) >> 3;
if (0 != buf->vb.baddr && buf->vb.bsize < buf->vb.size)
return -EINVAL;
@@ -888,12 +891,12 @@ static int res_get(struct em28xx_fh *fh, unsigned int bit)
static int res_check(struct em28xx_fh *fh, unsigned int bit)
{
- return (fh->resources & bit);
+ return fh->resources & bit;
}
static int res_locked(struct em28xx *dev, unsigned int bit)
{
- return (dev->resources & bit);
+ return dev->resources & bit;
}
static void res_free(struct em28xx_fh *fh, unsigned int bits)
@@ -1096,7 +1099,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
} else {
/* width must even because of the YUYV format
height must be even because of interlacing */
- v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh, 1, 0);
+ v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh,
+ 1, 0);
}
get_scale(dev, width, height, &hscale, &vscale);
@@ -1754,7 +1758,7 @@ static int vidioc_streamon(struct file *file, void *priv,
em28xx_videodbg("vidioc_streamon fh=%p t=%d fh->res=%d dev->res=%d\n",
fh, type, fh->resources, dev->resources);
- if (unlikely(!res_get(fh,get_ressource(fh))))
+ if (unlikely(!res_get(fh, get_ressource(fh))))
return -EBUSY;
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
@@ -1977,9 +1981,8 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
return videobuf_qbuf(&fh->vb_vidq, b);
- else {
+ else
return videobuf_qbuf(&fh->vb_vbiq, b);
- }
}
static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
@@ -2140,7 +2143,7 @@ static int em28xx_v4l2_open(struct file *filp)
#if 0
errCode = em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
if (errCode < 0) {
- em28xx_errdev("Device locked on digital mode. Can't open analog\n");
+ em28xx_errdev("Locked on digital mode. Can't open analog\n");
mutex_unlock(&dev->lock);
return -EBUSY;
}
@@ -2263,7 +2266,7 @@ static int em28xx_v4l2_close(struct file *filp)
res_free(fh, EM28XX_RESOURCE_VBI);
}
- if(dev->users == 1) {
+ if (dev->users == 1) {
/* the device is already disconnect,
free the remaining resources */
if (dev->state & DEV_DISCONNECTED) {