summaryrefslogtreecommitdiff
path: root/lib/mpi
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@chromium.org>2015-08-07 13:59:23 -0700
committerEduardo Valentin <edubezval@gmail.com>2015-10-30 11:07:32 -0700
commitd9a241cbbdca9ead3322c073dbb9dbf61ac76ef0 (patch)
tree34b749f70f2d80bead0e86c8f0f69288e33a5e14 /lib/mpi
parent9876b1a4431a3f0959c70e1d817ecab6440cb2e6 (diff)
thermal: rockchip: fix handling of invalid readings
We attempted to signal invalid code by returning -EAGAIN from rk_tsadcv2_code_to_temp(), unfortunately the return value was stuffed directly into the temperature pointer, potentially confusing upper layers with temperature of -EINVAL. Let's split temperature from error/success indicator to avoid such confusion. Also change the way we scan the temperature table to start with the 2nd element so that we do not need to worry that we may reference out of bounds element while doing binary search and keep checking that we end up with 'mid' equal to 0 (since we are looking for the temperature that would fall into interval between the 'mid' and 'mid - 1') . Tested-by: Caesar Wang <wxt@rock-chips.com> Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'lib/mpi')
0 files changed, 0 insertions, 0 deletions