aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
460 u8 mask, u8 set) 460 u8 mask, u8 set)
461{ 461{
462 s32 val = i2c_smbus_read_byte_data(client, command); 462 s32 val = i2c_smbus_read_byte_data(client, command);
463 if (val < 0)
464 return val;
463 465
464 val &= ~mask; 466 val &= ~mask;
465 val |= set; 467 val |= set & mask;
466 468
467 return i2c_smbus_write_byte_data(client, command, val); 469 return i2c_smbus_write_byte_data(client, command, val);
468} 470}