diff options
author | Radhesh Fadnis | 2012-09-19 19:07:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2012-09-21 17:56:40 +0200 |
commit | 463bf503bdab90bf269ad2a70656fe8536ff4933 (patch) | |
tree | 41a44b2b23e5d3575dc9b788f496d5daf49f8050 /drivers/staging/omap-thermal | |
parent | staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd (diff) | |
download | kernel-qcow2-linux-463bf503bdab90bf269ad2a70656fe8536ff4933.tar.gz kernel-qcow2-linux-463bf503bdab90bf269ad2a70656fe8536ff4933.tar.xz kernel-qcow2-linux-463bf503bdab90bf269ad2a70656fe8536ff4933.zip |
staging: omap-thermal: bandgap: fix setting of alert thresholds
There was an error in check for the valid temperature in
function temp_to_adc_conversion. The temperature value was
compared with higher limit for less than condition as well,
resulting in returning -EINVAL. Corrected the check condition
to properly check for lower and higher temperature limits.
Signed-off-by: Radhesh Fadnis <radhesh.fadnis@ti.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/omap-thermal')
-rw-r--r-- | drivers/staging/omap-thermal/omap-bandgap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/omap-thermal/omap-bandgap.c b/drivers/staging/omap-thermal/omap-bandgap.c index ff93c15d349b..368a2e19b2d4 100644 --- a/drivers/staging/omap-thermal/omap-bandgap.c +++ b/drivers/staging/omap-thermal/omap-bandgap.c @@ -157,7 +157,7 @@ static int temp_to_adc_conversion(long temp, struct omap_bandgap *bg_ptr, int i, high = ts_data->adc_end_val - ts_data->adc_start_val; mid = (high + low) / 2; - if (temp < bg_ptr->conv_table[high] || temp > bg_ptr->conv_table[high]) + if (temp < bg_ptr->conv_table[low] || temp > bg_ptr->conv_table[high]) return -EINVAL; while (low < high) { |