power: supply: sbs-battery: remove incorrect le16_to_cpu calls

i2c_smbus commands handle the correct byte order for smbus transactions
internally. This will currently result in incorrect operation on big
endian systems.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:
Phil Reid 2017-06-15 21:59:29 +08:00 committed by Sebastian Reichel
parent fc44313830
commit a1bbec72f9

View File

@ -199,7 +199,7 @@ static int sbs_read_word_data(struct i2c_client *client, u8 address)
return ret; return ret;
} }
return le16_to_cpu(ret); return ret;
} }
static int sbs_read_string_data(struct i2c_client *client, u8 address, static int sbs_read_string_data(struct i2c_client *client, u8 address,
@ -265,7 +265,7 @@ static int sbs_read_string_data(struct i2c_client *client, u8 address,
memcpy(values, block_buffer + 1, block_length); memcpy(values, block_buffer + 1, block_length);
values[block_length] = '\0'; values[block_length] = '\0';
return le16_to_cpu(ret); return ret;
} }
static int sbs_write_word_data(struct i2c_client *client, u8 address, static int sbs_write_word_data(struct i2c_client *client, u8 address,
@ -278,8 +278,7 @@ static int sbs_write_word_data(struct i2c_client *client, u8 address,
retries = chip->i2c_retry_count; retries = chip->i2c_retry_count;
while (retries > 0) { while (retries > 0) {
ret = i2c_smbus_write_word_data(client, address, ret = i2c_smbus_write_word_data(client, address, value);
le16_to_cpu(value));
if (ret >= 0) if (ret >= 0)
break; break;
retries--; retries--;