From: Jonathan Cameron Date: Tue, 29 Nov 2011 19:23:27 +0000 (-0800) Subject: Input: ad7879-i2c - use swapped variant of i2c_smbus_read_word_data X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=75255b29d473613e2a5737d6fb368dc4009c90a8;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git Input: ad7879-i2c - use swapped variant of i2c_smbus_read_word_data 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 Acked-by: Michael Hennerich Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c index b746702a8551..0dac6712f42b 100644 --- a/drivers/input/touchscreen/ad7879-i2c.c +++ b/drivers/input/touchscreen/ad7879-i2c.c @@ -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, @@ -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 = {