diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-11-04 07:00:47 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-11-04 07:00:47 -0400 |
commit | 90f4102ce59226954edbe960b2434d8b3da5f086 (patch) | |
tree | 93fd275039932253b16ea125c1ba5eea2995b719 /drivers/hwmon/gl518sm.c | |
parent | 371f2e083b9b081adf68d04fba4978a27dc4e618 (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/gl518sm.c')
-rw-r--r-- | drivers/hwmon/gl518sm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c index e7ae5743e181..a13e2da97e30 100644 --- a/drivers/hwmon/gl518sm.c +++ b/drivers/hwmon/gl518sm.c | |||
@@ -591,7 +591,7 @@ static int gl518_remove(struct i2c_client *client) | |||
591 | static int gl518_read_value(struct i2c_client *client, u8 reg) | 591 | static int gl518_read_value(struct i2c_client *client, u8 reg) |
592 | { | 592 | { |
593 | if ((reg >= 0x07) && (reg <= 0x0c)) | 593 | if ((reg >= 0x07) && (reg <= 0x0c)) |
594 | return swab16(i2c_smbus_read_word_data(client, reg)); | 594 | return i2c_smbus_read_word_swapped(client, reg); |
595 | else | 595 | else |
596 | return i2c_smbus_read_byte_data(client, reg); | 596 | return i2c_smbus_read_byte_data(client, reg); |
597 | } | 597 | } |
@@ -599,7 +599,7 @@ static int gl518_read_value(struct i2c_client *client, u8 reg) | |||
599 | static int gl518_write_value(struct i2c_client *client, u8 reg, u16 value) | 599 | static int gl518_write_value(struct i2c_client *client, u8 reg, u16 value) |
600 | { | 600 | { |
601 | if ((reg >= 0x07) && (reg <= 0x0c)) | 601 | if ((reg >= 0x07) && (reg <= 0x0c)) |
602 | return i2c_smbus_write_word_data(client, reg, swab16(value)); | 602 | return i2c_smbus_write_word_swapped(client, reg, value); |
603 | else | 603 | else |
604 | return i2c_smbus_write_byte_data(client, reg, value); | 604 | return i2c_smbus_write_byte_data(client, reg, value); |
605 | } | 605 | } |