From 90f4102ce59226954edbe960b2434d8b3da5f086 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 4 Nov 2011 12:00:47 +0100 Subject: hwmon: Use i2c_smbus_{read,write}_word_swapped Make use of the new i2c_smbus_{read,write}_word_swapped functions. This makes the driver code more compact and readable. It also ensures proper error handling. Signed-off-by: Jean Delvare Acked-by: Jonathan Cameron Acked-by: Guenter Roeck Cc: Dirk Eibach Cc: "Mark M. Hoffman" Cc: Guillaume Ligneul --- drivers/hwmon/lm77.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/hwmon/lm77.c') diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c index b28a297..8dfc678 100644 --- a/drivers/hwmon/lm77.c +++ b/drivers/hwmon/lm77.c @@ -365,7 +365,7 @@ static u16 lm77_read_value(struct i2c_client *client, u8 reg) if (reg == LM77_REG_CONF) return i2c_smbus_read_byte_data(client, reg); else - return swab16(i2c_smbus_read_word_data(client, reg)); + return i2c_smbus_read_word_swapped(client, reg); } static int lm77_write_value(struct i2c_client *client, u8 reg, u16 value) @@ -373,7 +373,7 @@ static int lm77_write_value(struct i2c_client *client, u8 reg, u16 value) if (reg == LM77_REG_CONF) return i2c_smbus_write_byte_data(client, reg, value); else - return i2c_smbus_write_word_data(client, reg, swab16(value)); + return i2c_smbus_write_word_swapped(client, reg, value); } static void lm77_init_client(struct i2c_client *client) -- cgit v1.1