]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
power: supply: bq24735: remove incorrect le16_to_cpu calls
authorPhil Reid <preid@electromag.com.au>
Thu, 15 Jun 2017 13:59:30 +0000 (21:59 +0800)
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>
Thu, 15 Jun 2017 14:47:35 +0000 (16:47 +0200)
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>
drivers/power/supply/bq24735-charger.c

index eb0145380def28f16282d490535a48e3d4b0f379..6931e1d826f55e82eaecc17a23d81f48b62917bd 100644 (file)
@@ -81,14 +81,12 @@ static int bq24735_charger_property_is_writeable(struct power_supply *psy,
 static inline int bq24735_write_word(struct i2c_client *client, u8 reg,
                                     u16 value)
 {
-       return i2c_smbus_write_word_data(client, reg, le16_to_cpu(value));
+       return i2c_smbus_write_word_data(client, reg, value);
 }
 
 static inline int bq24735_read_word(struct i2c_client *client, u8 reg)
 {
-       s32 ret = i2c_smbus_read_word_data(client, reg);
-
-       return ret < 0 ? ret : le16_to_cpu(ret);
+       return i2c_smbus_read_word_data(client, reg);
 }
 
 static int bq24735_update_word(struct i2c_client *client, u8 reg,