diff options
author | Anton Blanchard <anton@samba.org> | 2014-03-28 06:34:10 +0100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-04-09 04:52:49 +0200 |
commit | 9000c17dc0f9c910267d2661225c9d33a227b27e (patch) | |
tree | 66b0baf3e320446da2c335c53f6dc9be75d52e15 /arch/powerpc/platforms | |
parent | powerpc/powernv: Fix endian issues with OPAL async code (diff) | |
download | linux-9000c17dc0f9c910267d2661225c9d33a227b27e.tar.xz linux-9000c17dc0f9c910267d2661225c9d33a227b27e.zip |
powerpc/powernv: Fix endian issues with sensor code
One OPAL call and one device tree property needed byte swapping.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-sensor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/powernv/opal-sensor.c index 7503e298c4c3..10271ad1fac4 100644 --- a/arch/powerpc/platforms/powernv/opal-sensor.c +++ b/arch/powerpc/platforms/powernv/opal-sensor.c @@ -33,6 +33,7 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data) { int ret, token; struct opal_msg msg; + __be32 data; token = opal_async_get_token_interruptible(); if (token < 0) { @@ -42,7 +43,7 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data) } mutex_lock(&opal_sensor_mutex); - ret = opal_sensor_read(sensor_hndl, token, sensor_data); + ret = opal_sensor_read(sensor_hndl, token, &data); if (ret != OPAL_ASYNC_COMPLETION) goto out_token; @@ -53,6 +54,7 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data) goto out_token; } + *sensor_data = be32_to_cpu(data); ret = be64_to_cpu(msg.params[1]); out_token: |