diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-10-21 14:30:25 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-07 13:39:29 +0100 |
commit | 3f8770454b82c166662201a8966476f4538cbfeb (patch) | |
tree | 4092eed169d90ef91790936fa58629e8738a2bab /drivers/media/video/mt9v022.c | |
parent | [media] anysee: fix style issues (diff) | |
download | linux-3f8770454b82c166662201a8966476f4538cbfeb.tar.xz linux-3f8770454b82c166662201a8966476f4538cbfeb.zip |
[media] v4l: use i2c_smbus_read_word_swapped
Function ensures that error codes don't get mangled.
Dependant on:
which is working it's way through the i2c tree.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mt9v022.c')
-rw-r--r-- | drivers/media/video/mt9v022.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index b6a29f7de82c..c5c67ec8fd78 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c @@ -129,14 +129,13 @@ static struct mt9v022 *to_mt9v022(const struct i2c_client *client) static int reg_read(struct i2c_client *client, const u8 reg) { - s32 data = i2c_smbus_read_word_data(client, reg); - return data < 0 ? data : swab16(data); + return i2c_smbus_read_word_swapped(client, reg); } static int reg_write(struct i2c_client *client, const u8 reg, const u16 data) { - return i2c_smbus_write_word_data(client, reg, swab16(data)); + return i2c_smbus_write_word_swapped(client, reg, data); } static int reg_set(struct i2c_client *client, const u8 reg, |