diff options
author | Cédric Le Goater <clg@fr.ibm.com> | 2015-03-30 13:06:09 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-03-31 06:50:33 +0300 |
commit | e3c5c2e0bc857c7cbdb81f35a6b90236c5f330e9 (patch) | |
tree | bf62f0f6a535426d53b389a2e1aab229461ea302 /arch/powerpc/platforms/powernv/opal-sensor.c | |
parent | acdb66857fb9a713c93bb3e6edba5ee478ba0678 (diff) | |
download | linux-e3c5c2e0bc857c7cbdb81f35a6b90236c5f330e9.tar.xz |
powerpc/powernv: convert codes returned by OPAL calls
OPAL has its own list of return codes. The patch provides a translation
of such codes in errnos for the opal_sensor_read call, and possibly
others if needed.
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-sensor.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-sensor.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/powernv/opal-sensor.c index 4ab67ef7abc9..e9c5d8f33d4c 100644 --- a/arch/powerpc/platforms/powernv/opal-sensor.c +++ b/arch/powerpc/platforms/powernv/opal-sensor.c @@ -46,8 +46,10 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data) mutex_lock(&opal_sensor_mutex); ret = opal_sensor_read(sensor_hndl, token, &data); - if (ret != OPAL_ASYNC_COMPLETION) + if (ret != OPAL_ASYNC_COMPLETION) { + ret = opal_error_code(ret); goto out_token; + } ret = opal_async_wait_response(token, &msg); if (ret) { @@ -57,7 +59,7 @@ int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data) } *sensor_data = be32_to_cpu(data); - ret = be64_to_cpu(msg.params[1]); + ret = opal_error_code(be64_to_cpu(msg.params[1])); out_token: mutex_unlock(&opal_sensor_mutex); |