]> git.karo-electronics.de Git - linux-beck.git/commitdiff
powerpc/powernv: Fix little endian issues in OPAL flash code
authorAnton Blanchard <anton@samba.org>
Wed, 23 Apr 2014 21:25:34 +0000 (07:25 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Apr 2014 03:08:50 +0000 (13:08 +1000)
With this patch I was able to update firmware on an LE kernel.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powernv/opal-flash.c

index 714ef972406bcacf66a4a896283c6fb25963ca16..a968fd1888b3187b4774265cd8218fd691e090c9 100644 (file)
@@ -131,11 +131,15 @@ static DEFINE_MUTEX(image_data_mutex);
  */
 static inline void opal_flash_validate(void)
 {
-       struct validate_flash_t *args_buf = &validate_flash_data;
+       long ret;
+       void *buf = validate_flash_data.buf;
+       __be32 size, result;
+
+       ret = opal_validate_flash(__pa(buf), &size, &result);
 
-       args_buf->status = opal_validate_flash(__pa(args_buf->buf),
-                                              &(args_buf->buf_size),
-                                              &(args_buf->result));
+       validate_flash_data.status = ret;
+       validate_flash_data.buf_size = be32_to_cpu(size);
+       validate_flash_data.result = be32_to_cpu(result);
 }
 
 /*