V4L/DVB (7162): em28xx: Fix endian and returns the correct values
authorMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 6 Feb 2008 18:56:16 +0000 (15:56 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 18 Feb 2008 14:15:15 +0000 (11:15 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/em28xx/em28xx-video.c

index 4c836ad5cf41e5d45b89e21a22118ec8dbc1648d..f69f591eeaf6fc768245d6b5854638f3f1407796 100644 (file)
@@ -861,13 +861,13 @@ static int vidioc_g_register(struct file *file, void *priv,
 
                reg->val = ret;
        } else {
-               u16 val;
+               u64 val = 0;
                ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS,
                                                   reg->reg, (char *)&val, 2);
                if (ret < 0)
                        return ret;
 
-               reg->val = val;
+               reg->val = cpu_to_le64((__u64)val);
        }
 
        return 0;
@@ -878,9 +878,9 @@ static int vidioc_s_register(struct file *file, void *priv,
 {
        struct em28xx_fh      *fh  = priv;
        struct em28xx         *dev = fh->dev;
-       u16 buf;
+       u64 buf;
 
-       buf = be16_to_cpu((__u16)reg->val);
+       buf = le64_to_cpu((__u64)reg->val);
 
        return em28xx_write_regs(dev, reg->reg, (char *)&buf,
                                 em28xx_reg_len(reg->reg));