mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-11 15:14:03 +08:00
V4L/DVB (7162): em28xx: Fix endian and returns the correct values
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
0da5176f4e
commit
0df8130fe8
@ -861,13 +861,13 @@ static int vidioc_g_register(struct file *file, void *priv,
|
|||||||
|
|
||||||
reg->val = ret;
|
reg->val = ret;
|
||||||
} else {
|
} else {
|
||||||
u16 val;
|
u64 val = 0;
|
||||||
ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS,
|
ret = em28xx_read_reg_req_len(dev, USB_REQ_GET_STATUS,
|
||||||
reg->reg, (char *)&val, 2);
|
reg->reg, (char *)&val, 2);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
reg->val = val;
|
reg->val = cpu_to_le64((__u64)val);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -878,9 +878,9 @@ static int vidioc_s_register(struct file *file, void *priv,
|
|||||||
{
|
{
|
||||||
struct em28xx_fh *fh = priv;
|
struct em28xx_fh *fh = priv;
|
||||||
struct em28xx *dev = fh->dev;
|
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,
|
return em28xx_write_regs(dev, reg->reg, (char *)&buf,
|
||||||
em28xx_reg_len(reg->reg));
|
em28xx_reg_len(reg->reg));
|
||||||
|
Loading…
Reference in New Issue
Block a user