powerpc/powernv: Handle OPAL_WRONG_STATE in opal_get_sensor_data()
authorVipin K Parashar <vipin@linux.vnet.ibm.com>
Fri, 10 Mar 2017 11:57:32 +0000 (17:27 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 31 Mar 2017 04:22:56 +0000 (15:22 +1100)
commit17bb69515c6dfbe282e8a9df08ffb719ff4dbc73
treedbdce278e818cd83380f6f76fae42982d233b256
parent4f9b514b765a3057341f3236c94877d9413babc7
powerpc/powernv: Handle OPAL_WRONG_STATE in opal_get_sensor_data()

OPAL returns OPAL_WRONG_STATE upon failing to provide sensor data due to
core sleeping/offline. Add a check in opal_get_sensor_data() for sensor
read failure with OPAL_WRONG_STATE return code and return -EIO.

Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal-sensor.c