]> git.karo-electronics.de Git - linux-beck.git/commitdiff
V4L/DVB (11820): Siano: smscore - fix byte ordering bug
authorUri Shkolnik <uris@siano-ms.com>
Sun, 17 May 2009 09:01:03 +0000 (06:01 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 22:14:34 +0000 (19:14 -0300)
Fix byte ordering bug.

Signed-off-by: Uri Shkolnik <uris@siano-ms.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/siano/smscoreapi.c

index 9a5358caec462358e14650660320e71beeb5244b..e80641afa52a5cdd1f52a70c15be1c53c6de148f 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <linux/firmware.h>
 #include <linux/wait.h>
+#include <asm/byteorder.h>
 
 #include "smscoreapi.h"
 #include "sms-cards.h"
@@ -511,9 +512,13 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,
 {
        struct SmsFirmware_ST *firmware = (struct SmsFirmware_ST *) buffer;
        struct SmsMsgHdr_ST *msg;
-       u32 mem_address = firmware->StartAddress;
+       u32 mem_address;
        u8 *payload = firmware->Payload;
        int rc = 0;
+       firmware->StartAddress = le32_to_cpu(firmware->StartAddress);
+       firmware->Length = le32_to_cpu(firmware->Length);
+
+       mem_address = firmware->StartAddress;
 
        sms_info("loading FW to addr 0x%x size %d",
                 mem_address, firmware->Length);