From patchwork Mon Jan 19 00:53:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3087 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0J7Ht8g004527 for ; Sun, 18 Jan 2009 23:17:55 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751479AbZASHWV (ORCPT ); Mon, 19 Jan 2009 02:22:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753510AbZASHWV (ORCPT ); Mon, 19 Jan 2009 02:22:21 -0500 Received: from mail.renesas.com ([202.234.163.13]:45710 "EHLO mail03.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751479AbZASHWU (ORCPT ); Mon, 19 Jan 2009 02:22:20 -0500 X-AuditID: ac140386-0000000700001aa8-94-49742a262ac0 Received: from guardian03.idc.renesas.com ([172.20.8.202]) by mail03.idc.renesas.com (sendmail) with ESMTP id n0J7MDsg000080; Mon, 19 Jan 2009 16:22:13 +0900 (JST) Received: (from root@localhost) by guardian03.idc.renesas.com with id n0J7MB6V004305; Mon, 19 Jan 2009 16:22:11 +0900 (JST) Received: from mta03.idc.renesas.com (localhost [127.0.0.1]) by mta03.idc.renesas.com with ESMTP id n0J7MDdE021355; Mon, 19 Jan 2009 16:22:13 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KDP0098PJ4ZCX@ims05.idc.renesas.com>; Mon, 19 Jan 2009 16:22:11 +0900 (JST) Date: Mon, 19 Jan 2009 09:53:10 +0900 From: Kuninori Morimoto Subject: [PATCH 1/2] ov772x: bit mask operation fix on ov772x_mask_set. To: Guennadi Liakhovetski Cc: Linux Media Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Kuninori Morimoto --- drivers/media/video/ov772x.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index b75420d..c8e10d3 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c @@ -566,8 +566,11 @@ static int ov772x_mask_set(struct i2c_client *client, 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); }