diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-06 13:56:16 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-18 09:15:15 -0500 |
commit | 0df8130fe80ebde052516c1d729aa5d1c69ebc5c (patch) | |
tree | e1854bd1ad058360584f0abc46ee3104b6c67b5e /drivers/media | |
parent | 0da5176f4e0d5aea3e33a11a17c1847939df4dcc (diff) |
V4L/DVB (7162): em28xx: Fix endian and returns the correct values
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 4c836ad5cf41..f69f591eeaf6 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -861,13 +861,13 @@ static int vidioc_g_register(struct file *file, void *priv, | |||
861 | 861 | ||
862 | reg->val = ret; | 862 | reg->val = ret; |
863 | } else { | 863 | } else { |
864 | u16 val; | 864 | u64 val = 0; |
865 | ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS, | 865 | ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS, |
866 | reg->reg, (char *)&val, 2); | 866 | reg->reg, (char *)&val, 2); |
867 | if (ret < 0) | 867 | if (ret < 0) |
868 | return ret; | 868 | return ret; |
869 | 869 | ||
870 | reg->val = val; | 870 | reg->val = cpu_to_le64((__u64)val); |
871 | } | 871 | } |
872 | 872 | ||
873 | return 0; | 873 | return 0; |
@@ -878,9 +878,9 @@ static int vidioc_s_register(struct file *file, void *priv, | |||
878 | { | 878 | { |
879 | struct em28xx_fh *fh = priv; | 879 | struct em28xx_fh *fh = priv; |
880 | struct em28xx *dev = fh->dev; | 880 | struct em28xx *dev = fh->dev; |
881 | u16 buf; | 881 | u64 buf; |
882 | 882 | ||
883 | buf = be16_to_cpu((__u16)reg->val); | 883 | buf = le64_to_cpu((__u64)reg->val); |
884 | 884 | ||
885 | return em28xx_write_regs(dev, reg->reg, (char *)&buf, | 885 | return em28xx_write_regs(dev, reg->reg, (char *)&buf, |
886 | em28xx_reg_len(reg->reg)); | 886 | em28xx_reg_len(reg->reg)); |