summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-firmware.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-07-20 09:42:59 +0200
committerPaul Mundt <lethal@linux-sh.org>2012-07-20 09:42:59 +0200
commit9ff561fdf73493d757bbc74aa58627e1381650fb (patch)
tree4484d230662126b1ac94ea545ca5429c91e0a68b /drivers/media/video/cx18/cx18-firmware.c
parentMerge branch 'common/pfc' into sh-latest (diff)
parentsh: pfc: pin config get/set support. (diff)
downloadlinux-9ff561fdf73493d757bbc74aa58627e1381650fb.tar.xz
linux-9ff561fdf73493d757bbc74aa58627e1381650fb.zip
Merge branch 'common/pinctrl' into sh-latest
Diffstat (limited to 'drivers/media/video/cx18/cx18-firmware.c')
-rw-r--r--drivers/media/video/cx18/cx18-firmware.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-firmware.c b/drivers/media/video/cx18/cx18-firmware.c
index 1b3fb502e6be..b85c292a849a 100644
--- a/drivers/media/video/cx18/cx18-firmware.c
+++ b/drivers/media/video/cx18/cx18-firmware.c
@@ -164,8 +164,13 @@ static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx,
apu_version = (vers[0] << 24) | (vers[4] << 16) | vers[32];
while (offset + sizeof(seghdr) < fw->size) {
- /* TODO: byteswapping */
- memcpy(&seghdr, src + offset / 4, sizeof(seghdr));
+ const u32 *shptr = src + offset / 4;
+
+ seghdr.sync1 = le32_to_cpu(shptr[0]);
+ seghdr.sync2 = le32_to_cpu(shptr[1]);
+ seghdr.addr = le32_to_cpu(shptr[2]);
+ seghdr.size = le32_to_cpu(shptr[3]);
+
offset += sizeof(seghdr);
if (seghdr.sync1 != APU_ROM_SYNC1 ||
seghdr.sync2 != APU_ROM_SYNC2) {