diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-26 22:43:00 +0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-03-29 13:16:46 +0400 |
commit | 34244ceccd99fab2a2640a5af7cc5a94d02c91cd (patch) | |
tree | 6ecaf04a9a3ae83419076c2d1bd556d59491b167 /drivers/staging/iio | |
parent | 8c7e862700285be2bfdca215012eb62cc28e9a48 (diff) | |
download | linux-34244ceccd99fab2a2640a5af7cc5a94d02c91cd.tar.xz |
staging:iio:ad799x: Use i2c_smbus_{read,write}_word_data_swapped
Use i2c_smbus_{read,write}_word_data_swapped instead of open-coding it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/adc/ad799x_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c index d12a4b264891..8d2012cfa59e 100644 --- a/drivers/staging/iio/adc/ad799x_core.c +++ b/drivers/staging/iio/adc/ad799x_core.c @@ -48,13 +48,13 @@ static int ad799x_i2c_read16(struct ad799x_state *st, u8 reg, u16 *data) struct i2c_client *client = st->client; int ret = 0; - ret = i2c_smbus_read_word_data(client, reg); + ret = i2c_smbus_read_word_swapped(client, reg); if (ret < 0) { dev_err(&client->dev, "I2C read error\n"); return ret; } - *data = swab16((u16)ret); + *data = (u16)ret; return 0; } @@ -80,7 +80,7 @@ static int ad799x_i2c_write16(struct ad799x_state *st, u8 reg, u16 data) struct i2c_client *client = st->client; int ret = 0; - ret = i2c_smbus_write_word_data(client, reg, swab16(data)); + ret = i2c_smbus_write_word_swapped(client, reg, data); if (ret < 0) dev_err(&client->dev, "I2C write error\n"); |