Commit a619477f authored by Eduardo Valentin's avatar Eduardo Valentin Committed by Greg Kroah-Hartman

staging: omap-thermal: rewrite omap_bandgap_mcelsius_to_adc on kernel coding style

Follow Documentation/CodingStyle while doing omap_bandgap_mcelsius_to_adc
Signed-off-by: default avatarEduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e16f072d
...@@ -270,14 +270,16 @@ int omap_bandgap_mcelsius_to_adc(struct omap_bandgap *bg_ptr, int i, long temp, ...@@ -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; struct temp_sensor_data *ts_data = bg_ptr->conf->sensors[i].ts_data;
const int *conv_table = bg_ptr->conf->conv_table; const int *conv_table = bg_ptr->conf->conv_table;
int high, low, mid; int high, low, mid, ret = 0;
low = 0; low = 0;
high = ts_data->adc_end_val - ts_data->adc_start_val; high = ts_data->adc_end_val - ts_data->adc_start_val;
mid = (high + low) / 2; mid = (high + low) / 2;
if (temp < conv_table[low] || temp > conv_table[high]) if (temp < conv_table[low] || temp > conv_table[high]) {
return -EINVAL; ret = -ERANGE;
goto exit;
}
while (low < high) { while (low < high) {
if (temp < conv_table[mid]) if (temp < conv_table[mid])
...@@ -289,7 +291,8 @@ int omap_bandgap_mcelsius_to_adc(struct omap_bandgap *bg_ptr, int i, long temp, ...@@ -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; *adc = ts_data->adc_start_val + low;
return 0; exit:
return ret;
} }
/* Talert masks. Call it only if HAS(TALERT) is set */ /* Talert masks. Call it only if HAS(TALERT) is set */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment