Skip to content

Commit

Permalink
staging: omap-thermal: bandgap: fix setting of alert thresholds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Radhesh Fadnis authored and Greg Kroah-Hartman committed Sep 21, 2012
1 parent cbf7d12 commit 463bf50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/omap-thermal/omap-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 463bf50

Please sign in to comment.