summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2014-04-24 07:25:34 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-28 13:08:50 +1000
commitcc146d1db0673396429ce4f906350d684ef4ca2a (patch)
treed2299506adc3bd4591522230b10c81d9620cac48 /arch
parent298b34d7d578c3b4325248b823f3d83a8ea1541c (diff)
downloadlinux-cc146d1db0673396429ce4f906350d684ef4ca2a.tar.bz2
powerpc/powernv: Fix little endian issues in OPAL flash code
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/powernv/opal-flash.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
index 714ef972406b..a968fd1888b3 100644
--- a/arch/powerpc/platforms/powernv/opal-flash.c
+++ b/arch/powerpc/platforms/powernv/opal-flash.c
@@ -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);
}
/*