Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363358
b: refs/heads/master
c: c8a8f84
h: refs/heads/master
v: v3
  • Loading branch information
Eduardo Valentin authored and Greg Kroah-Hartman committed Mar 11, 2013
1 parent ea00d5e commit a02174d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 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: efba11940a28eaf529af912f078087931e4dbaaa
refs/heads/master: c8a8f847cc3762f07851e377c7b9515634372bb2
8 changes: 4 additions & 4 deletions trunk/drivers/staging/omap-thermal/omap-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int adc_to_temp_conversion(struct omap_bandgap *bg_ptr, int id, int adc_val,
if (adc_val < ts_data->adc_start_val || adc_val > ts_data->adc_end_val)
return -ERANGE;

*t = bg_ptr->conv_table[adc_val - ts_data->adc_start_val];
*t = bg_ptr->conf->conv_table[adc_val - ts_data->adc_start_val];

return 0;
}
Expand All @@ -188,17 +188,18 @@ static int temp_to_adc_conversion(long temp, struct omap_bandgap *bg_ptr, int i,
int *adc)
{
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;

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

if (temp < bg_ptr->conv_table[low] || temp > bg_ptr->conv_table[high])
if (temp < conv_table[low] || temp > conv_table[high])
return -EINVAL;

while (low < high) {
if (temp < bg_ptr->conv_table[mid])
if (temp < conv_table[mid])
high = mid - 1;
else
low = mid + 1;
Expand Down Expand Up @@ -911,7 +912,6 @@ int omap_bandgap_probe(struct platform_device *pdev)
goto free_irqs;
}

bg_ptr->conv_table = bg_ptr->conf->conv_table;
for (i = 0; i < bg_ptr->conf->sensor_count; i++) {
struct temp_sensor_registers *tsr;
u32 val;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/omap-thermal/omap-bandgap.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ struct omap_bandgap {
struct omap_bandgap_data *conf;
struct clk *fclock;
struct clk *div_clk;
const int *conv_table;
struct mutex bg_mutex; /* Mutex for irq and PM */
int irq;
int tshut_gpio;
Expand Down

0 comments on commit a02174d

Please sign in to comment.