diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-10-21 08:30:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-07 07:39:29 -0500 |
commit | 3f8770454b82c166662201a8966476f4538cbfeb (patch) | |
tree | 4092eed169d90ef91790936fa58629e8738a2bab /drivers/media/video/mt9v032.c | |
parent | 8f4ffb1d4752ebce153e88266ac1164e8ecc5854 (diff) |
[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/mt9v032.c')
-rw-r--r-- | drivers/media/video/mt9v032.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/mt9v032.c b/drivers/media/video/mt9v032.c index c64e1dc4cb4e..7906929f106e 100644 --- a/drivers/media/video/mt9v032.c +++ b/drivers/media/video/mt9v032.c | |||
@@ -138,10 +138,10 @@ static struct mt9v032 *to_mt9v032(struct v4l2_subdev *sd) | |||
138 | 138 | ||
139 | static int mt9v032_read(struct i2c_client *client, const u8 reg) | 139 | static int mt9v032_read(struct i2c_client *client, const u8 reg) |
140 | { | 140 | { |
141 | s32 data = i2c_smbus_read_word_data(client, reg); | 141 | s32 data = i2c_smbus_read_word_swapped(client, reg); |
142 | dev_dbg(&client->dev, "%s: read 0x%04x from 0x%02x\n", __func__, | 142 | dev_dbg(&client->dev, "%s: read 0x%04x from 0x%02x\n", __func__, |
143 | swab16(data), reg); | 143 | data, reg); |
144 | return data < 0 ? data : swab16(data); | 144 | return data; |
145 | } | 145 | } |
146 | 146 | ||
147 | static int mt9v032_write(struct i2c_client *client, const u8 reg, | 147 | static int mt9v032_write(struct i2c_client *client, const u8 reg, |
@@ -149,7 +149,7 @@ static int mt9v032_write(struct i2c_client *client, const u8 reg, | |||
149 | { | 149 | { |
150 | dev_dbg(&client->dev, "%s: writing 0x%04x to 0x%02x\n", __func__, | 150 | dev_dbg(&client->dev, "%s: writing 0x%04x to 0x%02x\n", __func__, |
151 | data, reg); | 151 | data, reg); |
152 | return i2c_smbus_write_word_data(client, reg, swab16(data)); | 152 | return i2c_smbus_write_word_swapped(client, reg, data); |
153 | } | 153 | } |
154 | 154 | ||
155 | static int mt9v032_set_chip_control(struct mt9v032 *mt9v032, u16 clear, u16 set) | 155 | static int mt9v032_set_chip_control(struct mt9v032 *mt9v032, u16 clear, u16 set) |