Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=025341d4f0caa58f0e5eddbffd11d44e37cff974
Commit:     025341d4f0caa58f0e5eddbffd11d44e37cff974
Parent:     55712ff7e06b721fbeebd36499bad4a11b7d8327
Author:     Mauro Carvalho Chehab <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 10 04:43:38 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 19:03:22 2008 -0200

    V4L/DVB (6755): Avoid troubles when using multiple devices
    
    mv_count is a counter used to move the vertical bars. Before this patch, it
    where a static var. This works fine for just one device. However, when using
    multiple devices, every device would increment it.
    
    This patch moves it to its correct place: struct vivi_dev. So, now, each 
device
    has its own data.
    
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/vivi.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index fda01f4..ea9ff8a 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -178,6 +178,8 @@ struct vivi_dev {
        /* Several counters */
        int                        h,m,s,us,jiffies;
        char                       timestr[13];
+
+       int                        mv_count;    /* Controls bars movement */
 };
 
 struct vivi_fh {
@@ -327,14 +329,12 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct 
vivi_buffer *buf)
        struct timeval ts;
        char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL);
        void *vbuf=videobuf_to_vmalloc (&buf->vb);
-       /* FIXME: move to dev struct */
-       static int mv_count=0;
 
        if (!tmpbuf)
                return;
 
        for (h=0;h<hmax;h++) {
-               gen_line(tmpbuf,0,wmax,hmax,h,mv_count,
+               gen_line(tmpbuf, 0, wmax, hmax, h, dev->mv_count,
                         dev->timestr);
                /* FIXME: replacing to __copy_to_user */
                if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0)
@@ -342,7 +342,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct 
vivi_buffer *buf)
                pos += wmax*2;
        }
 
-       mv_count++;
+       dev->mv_count++;
 
        kfree(tmpbuf);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to