Skip to content

Commit

Permalink
Input: ad7879-i2c - use swapped variant of i2c_smbus_read_word_data
Browse files Browse the repository at this point in the history
This variant was introduced in

i2c: boilerplate function for byte swapped smbus_write/read_word_data

This also has the side effect of ensuring any errors from the i2c
read and no longer mangled.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Jonathan Cameron authored and Dmitry Torokhov committed Dec 1, 2011
1 parent cdcc96e commit 75255b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/touchscreen/ad7879-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static int ad7879_i2c_read(struct device *dev, u8 reg)
{
struct i2c_client *client = to_i2c_client(dev);

return swab16(i2c_smbus_read_word_data(client, reg));
return i2c_smbus_read_word_swapped(client, reg);
}

static int ad7879_i2c_multi_read(struct device *dev,
Expand All @@ -44,7 +44,7 @@ static int ad7879_i2c_write(struct device *dev, u8 reg, u16 val)
{
struct i2c_client *client = to_i2c_client(dev);

return i2c_smbus_write_word_data(client, reg, swab16(val));
return i2c_smbus_write_word_swapped(client, reg, val);
}

static const struct ad7879_bus_ops ad7879_i2c_bus_ops = {
Expand Down

0 comments on commit 75255b2

Please sign in to comment.