diff options
author | Anton Blanchard <anton@samba.org> | 2013-12-13 08:53:43 +0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-12-13 08:53:59 +0400 |
commit | 01a9dbccbdfc7a93950b791405e476c510f73ab0 (patch) | |
tree | 7a16519c620adeb98dbbdbf8ec0d0f40bad49ff3 /arch/powerpc/platforms/powernv/opal-xscom.c | |
parent | a29e30efa3a1b253fd1252731aa774a3544c5c3b (diff) | |
download | linux-01a9dbccbdfc7a93950b791405e476c510f73ab0.tar.xz |
powerpc/powernv: Fix endian issue in opal_xscom_read
opal_xscom_read uses a pointer to return the data so we need
to byteswap it on LE builds.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-xscom.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-xscom.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c index 4d99a8fd55ac..4fbf276ac99e 100644 --- a/arch/powerpc/platforms/powernv/opal-xscom.c +++ b/arch/powerpc/platforms/powernv/opal-xscom.c @@ -96,9 +96,11 @@ static int opal_scom_read(scom_map_t map, u64 reg, u64 *value) { struct opal_scom_map *m = map; int64_t rc; + __be64 v; reg = opal_scom_unmangle(reg); - rc = opal_xscom_read(m->chip, m->addr + reg, (uint64_t *)__pa(value)); + rc = opal_xscom_read(m->chip, m->addr + reg, (__be64 *)__pa(&v)); + *value = be64_to_cpu(v); return opal_xscom_err_xlate(rc); } |