summaryrefslogtreecommitdiff
path: root/drivers/media/video/tw9910.c
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-02-23 18:12:58 +0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 19:42:52 +0400
commit1af1b7a2def2f0936fc95edb5dcb3871934b7852 (patch)
treedef0416c1e1f307982e119d2885671b731e96130 /drivers/media/video/tw9910.c
parent051489119affd527f2834e9f8ba3e2a71bf1ca23 (diff)
downloadlinux-1af1b7a2def2f0936fc95edb5dcb3871934b7852.tar.xz
V4L/DVB (10670): tw9910: bit mask operation fix on tw9910_mask_set.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/tw9910.c')
-rw-r--r--drivers/media/video/tw9910.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
index 8dc3ec79a06f..0558b22fd3fb 100644
--- a/drivers/media/video/tw9910.c
+++ b/drivers/media/video/tw9910.c
@@ -460,9 +460,11 @@ static int tw9910_mask_set(struct i2c_client *client, u8 command,
u8 mask, u8 set)
{
s32 val = i2c_smbus_read_byte_data(client, command);
+ if (val < 0)
+ return val;
val &= ~mask;
- val |= set;
+ val |= set & mask;
return i2c_smbus_write_byte_data(client, command, val);
}