diff options
Diffstat (limited to 'drivers/power/olpc_battery.c')
-rw-r--r-- | drivers/power/olpc_battery.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c index aafc1c506eda..5bc1dcf7785e 100644 --- a/drivers/power/olpc_battery.c +++ b/drivers/power/olpc_battery.c | |||
@@ -271,14 +271,14 @@ static int olpc_bat_get_property(struct power_supply *psy, | |||
271 | if (ret) | 271 | if (ret) |
272 | return ret; | 272 | return ret; |
273 | 273 | ||
274 | val->intval = (int)be16_to_cpu(ec_word) * 9760L / 32; | 274 | val->intval = (s16)be16_to_cpu(ec_word) * 9760L / 32; |
275 | break; | 275 | break; |
276 | case POWER_SUPPLY_PROP_CURRENT_AVG: | 276 | case POWER_SUPPLY_PROP_CURRENT_AVG: |
277 | ret = olpc_ec_cmd(EC_BAT_CURRENT, NULL, 0, (void *)&ec_word, 2); | 277 | ret = olpc_ec_cmd(EC_BAT_CURRENT, NULL, 0, (void *)&ec_word, 2); |
278 | if (ret) | 278 | if (ret) |
279 | return ret; | 279 | return ret; |
280 | 280 | ||
281 | val->intval = (int)be16_to_cpu(ec_word) * 15625L / 120; | 281 | val->intval = (s16)be16_to_cpu(ec_word) * 15625L / 120; |
282 | break; | 282 | break; |
283 | case POWER_SUPPLY_PROP_CAPACITY: | 283 | case POWER_SUPPLY_PROP_CAPACITY: |
284 | ret = olpc_ec_cmd(EC_BAT_SOC, NULL, 0, &ec_byte, 1); | 284 | ret = olpc_ec_cmd(EC_BAT_SOC, NULL, 0, &ec_byte, 1); |
@@ -299,7 +299,7 @@ static int olpc_bat_get_property(struct power_supply *psy, | |||
299 | if (ret) | 299 | if (ret) |
300 | return ret; | 300 | return ret; |
301 | 301 | ||
302 | val->intval = (int)be16_to_cpu(ec_word) * 100 / 256; | 302 | val->intval = (s16)be16_to_cpu(ec_word) * 100 / 256; |
303 | break; | 303 | break; |
304 | case POWER_SUPPLY_PROP_TEMP_AMBIENT: | 304 | case POWER_SUPPLY_PROP_TEMP_AMBIENT: |
305 | ret = olpc_ec_cmd(EC_AMB_TEMP, NULL, 0, (void *)&ec_word, 2); | 305 | ret = olpc_ec_cmd(EC_AMB_TEMP, NULL, 0, (void *)&ec_word, 2); |
@@ -313,7 +313,7 @@ static int olpc_bat_get_property(struct power_supply *psy, | |||
313 | if (ret) | 313 | if (ret) |
314 | return ret; | 314 | return ret; |
315 | 315 | ||
316 | val->intval = (int)be16_to_cpu(ec_word) * 6250 / 15; | 316 | val->intval = (s16)be16_to_cpu(ec_word) * 6250 / 15; |
317 | break; | 317 | break; |
318 | case POWER_SUPPLY_PROP_SERIAL_NUMBER: | 318 | case POWER_SUPPLY_PROP_SERIAL_NUMBER: |
319 | ret = olpc_ec_cmd(EC_BAT_SERIAL, NULL, 0, (void *)&ser_buf, 8); | 319 | ret = olpc_ec_cmd(EC_BAT_SERIAL, NULL, 0, (void *)&ser_buf, 8); |