Commit 773ddbd2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

[media] saa7164: fix endian conversion in saa7164_bus_set()

The msg->command field is 32 bits, and we should fill it with a call
to cpu_to_le32().  The current code is broke on big endian systems.
On little endian systems it truncates the 32 bit value to 16 bits
which probably still works fine.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: Steven Toth <stoth@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ed942c50
...@@ -149,7 +149,7 @@ int saa7164_bus_set(struct saa7164_dev *dev, struct tmComResInfo* msg, ...@@ -149,7 +149,7 @@ int saa7164_bus_set(struct saa7164_dev *dev, struct tmComResInfo* msg,
saa7164_bus_verify(dev); saa7164_bus_verify(dev);
msg->size = cpu_to_le16(msg->size); msg->size = cpu_to_le16(msg->size);
msg->command = cpu_to_le16(msg->command); msg->command = cpu_to_le32(msg->command);
msg->controlselector = cpu_to_le16(msg->controlselector); msg->controlselector = cpu_to_le16(msg->controlselector);
if (msg->size > dev->bus.m_wMaxReqSize) { if (msg->size > dev->bus.m_wMaxReqSize) {
...@@ -464,7 +464,7 @@ int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, ...@@ -464,7 +464,7 @@ int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg,
peekout: peekout:
msg->size = le16_to_cpu(msg->size); msg->size = le16_to_cpu(msg->size);
msg->command = le16_to_cpu(msg->command); msg->command = le32_to_cpu(msg->command);
msg->controlselector = le16_to_cpu(msg->controlselector); msg->controlselector = le16_to_cpu(msg->controlselector);
ret = SAA_OK; ret = SAA_OK;
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment