From patchwork Thu Feb 25 20:34:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 82155 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1PKZ94U026782 for ; Thu, 25 Feb 2010 20:35:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932934Ab0BYUeh (ORCPT ); Thu, 25 Feb 2010 15:34:37 -0500 Received: from smtp-vbr15.xs4all.nl ([194.109.24.35]:1122 "EHLO smtp-vbr15.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933375Ab0BYUef (ORCPT ); Thu, 25 Feb 2010 15:34:35 -0500 Received: from durdane.localnet (marune.xs4all.nl [82.95.89.49]) (authenticated bits=0) by smtp-vbr15.xs4all.nl (8.13.8/8.13.8) with ESMTP id o1PKYAUk014412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Feb 2010 21:34:10 +0100 (CET) (envelope-from hverkuil@xs4all.nl) From: Hans Verkuil To: Randy Dunlap Subject: Re: linux-next: Tree for February 22 (media/video/tvp7002) Date: Thu, 25 Feb 2010 21:34:09 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.32.5-durdane; KDE/4.3.1; i686; ; ) Cc: linux-next@vger.kernel.org, Stephen Rothwell , LKML , Linux Media Mailing List , "Santiago Nunez-Corrales" References: <20100222172218.4fd82a45.sfr@canb.auug.org.au> <4B82AF18.3030107@oracle.com> <20100225085205.9cf68ce9.randy.dunlap@oracle.com> In-Reply-To: <20100225085205.9cf68ce9.randy.dunlap@oracle.com> MIME-Version: 1.0 Message-Id: <201002252134.10071.hverkuil@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Feb 2010 20:35:11 +0000 (UTC) diff --git a/drivers/media/video/tvp7002.c b/drivers/media/video/tvp7002.c index 0f0270b..5a878bc 100644 --- a/drivers/media/video/tvp7002.c +++ b/drivers/media/video/tvp7002.c @@ -859,13 +859,17 @@ static int tvp7002_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) { struct i2c_client *client = v4l2_get_subdevdata(sd); + u8 val; + int ret; if (!v4l2_chip_match_i2c_client(client, ®->match)) return -EINVAL; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - return reg->val < 0 ? -EINVAL : 0; + ret = tvp7002_read(sd, reg->reg & 0xff, &val); + reg->val = val; + return ret; } /* @@ -881,21 +885,13 @@ static int tvp7002_s_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) { struct i2c_client *client = v4l2_get_subdevdata(sd); - struct tvp7002 *device = to_tvp7002(sd); - int wres; if (!v4l2_chip_match_i2c_client(client, ®->match)) return -EINVAL; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - wres = tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff); - - /* Update the register value in device's table */ - if (!wres) - device->registers[reg->reg].value = reg->val; - - return wres < 0 ? -EINVAL : 0; + return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff); } #endif