aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83781d.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2011-11-04 07:00:47 -0400
committerJean Delvare <khali@endymion.delvare>2011-11-04 07:00:47 -0400
commit90f4102ce59226954edbe960b2434d8b3da5f086 (patch)
tree93fd275039932253b16ea125c1ba5eea2995b719 /drivers/hwmon/w83781d.c
parent371f2e083b9b081adf68d04fba4978a27dc4e618 (diff)
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 <khali@linux-fr.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Dirk Eibach <eibach@gdsys.de> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
Diffstat (limited to 'drivers/hwmon/w83781d.c')
-rw-r--r--drivers/hwmon/w83781d.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index eed43a008be1..65b685e2c7b7 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1245,17 +1245,17 @@ w83781d_read_value_i2c(struct w83781d_data *data, u16 reg)
1245 /* convert from ISA to LM75 I2C addresses */ 1245 /* convert from ISA to LM75 I2C addresses */
1246 switch (reg & 0xff) { 1246 switch (reg & 0xff) {
1247 case 0x50: /* TEMP */ 1247 case 0x50: /* TEMP */
1248 res = swab16(i2c_smbus_read_word_data(cl, 0)); 1248 res = i2c_smbus_read_word_swapped(cl, 0);
1249 break; 1249 break;
1250 case 0x52: /* CONFIG */ 1250 case 0x52: /* CONFIG */
1251 res = i2c_smbus_read_byte_data(cl, 1); 1251 res = i2c_smbus_read_byte_data(cl, 1);
1252 break; 1252 break;
1253 case 0x53: /* HYST */ 1253 case 0x53: /* HYST */
1254 res = swab16(i2c_smbus_read_word_data(cl, 2)); 1254 res = i2c_smbus_read_word_swapped(cl, 2);
1255 break; 1255 break;
1256 case 0x55: /* OVER */ 1256 case 0x55: /* OVER */
1257 default: 1257 default:
1258 res = swab16(i2c_smbus_read_word_data(cl, 3)); 1258 res = i2c_smbus_read_word_swapped(cl, 3);
1259 break; 1259 break;
1260 } 1260 }
1261 } 1261 }
@@ -1289,10 +1289,10 @@ w83781d_write_value_i2c(struct w83781d_data *data, u16 reg, u16 value)
1289 i2c_smbus_write_byte_data(cl, 1, value & 0xff); 1289 i2c_smbus_write_byte_data(cl, 1, value & 0xff);
1290 break; 1290 break;
1291 case 0x53: /* HYST */ 1291 case 0x53: /* HYST */
1292 i2c_smbus_write_word_data(cl, 2, swab16(value)); 1292 i2c_smbus_write_word_swapped(cl, 2, value);
1293 break; 1293 break;
1294 case 0x55: /* OVER */ 1294 case 0x55: /* OVER */
1295 i2c_smbus_write_word_data(cl, 3, swab16(value)); 1295 i2c_smbus_write_word_swapped(cl, 3, value);
1296 break; 1296 break;
1297 } 1297 }
1298 } 1298 }