Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363476
b: refs/heads/master
c: a619477
h: refs/heads/master
v: v3
  • Loading branch information
Eduardo Valentin authored and Greg Kroah-Hartman committed Mar 15, 2013
1 parent b2ac18b commit 2137186
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e16f072d5d65a8df53ba4693f1334c453bd303aa
refs/heads/master: a619477f51908e1029a7f1afce7f56a856d6bb66
11 changes: 7 additions & 4 deletions trunk/drivers/staging/omap-thermal/omap-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,16 @@ int omap_bandgap_mcelsius_to_adc(struct omap_bandgap *bg_ptr, int i, long temp,
{
struct temp_sensor_data *ts_data = bg_ptr->conf->sensors[i].ts_data;
const int *conv_table = bg_ptr->conf->conv_table;
int high, low, mid;
int high, low, mid, ret = 0;

low = 0;
high = ts_data->adc_end_val - ts_data->adc_start_val;
mid = (high + low) / 2;

if (temp < conv_table[low] || temp > conv_table[high])
return -EINVAL;
if (temp < conv_table[low] || temp > conv_table[high]) {
ret = -ERANGE;
goto exit;
}

while (low < high) {
if (temp < conv_table[mid])
Expand All @@ -289,7 +291,8 @@ int omap_bandgap_mcelsius_to_adc(struct omap_bandgap *bg_ptr, int i, long temp,

*adc = ts_data->adc_start_val + low;

return 0;
exit:
return ret;
}

/* Talert masks. Call it only if HAS(TALERT) is set */
Expand Down

0 comments on commit 2137186

Please sign in to comment.