From patchwork Wed May 5 15:30:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 97134 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 o45FUGBx015459 for ; Wed, 5 May 2010 15:30:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757636Ab0EEPaN (ORCPT ); Wed, 5 May 2010 11:30:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32636 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754193Ab0EEPaM (ORCPT ); Wed, 5 May 2010 11:30:12 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o45FU6B3020212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 May 2010 11:30:06 -0400 Received: from [10.11.8.142] (vpn-8-142.rdu.redhat.com [10.11.8.142]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o45FU22i016292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 May 2010 11:30:04 -0400 Message-ID: <4BE18EF9.9010502@redhat.com> Date: Wed, 05 May 2010 12:30:01 -0300 From: Mauro Carvalho Chehab User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: Dan Carpenter , Palash Bandyopadhyay CC: Greg Kroah-Hartman , linux-media@vger.kernel.org Subject: Re: -next: staging/cx25821: please revert 7a02f549fcc References: <20100505072738.GH27064@bicker> In-Reply-To: <20100505072738.GH27064@bicker> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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]); Wed, 05 May 2010 15:30:16 +0000 (UTC) diff --git a/drivers/staging/cx25821/cx25821-medusa-video.c b/drivers/staging/cx25821/cx25821-medusa-video.c index 77ccef4..7545314 100644 --- a/drivers/staging/cx25821/cx25821-medusa-video.c +++ b/drivers/staging/cx25821/cx25821-medusa-video.c @@ -778,9 +778,9 @@ int medusa_set_saturation(struct cx25821_dev *dev, int saturation, int decoder) int medusa_video_init(struct cx25821_dev *dev) { - u32 value = 0, tmp = 0; - int ret_val = 0; - int i = 0; + u32 value, tmp = 0; + int ret_val; + int i; mutex_lock(&dev->lock); @@ -790,20 +790,15 @@ int medusa_video_init(struct cx25821_dev *dev) value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp); value &= 0xFFFFF0FF; ret_val = cx25821_i2c_write(&dev->i2c_bus[0], MON_A_CTRL, value); + if (ret_val < 0) + goto error; - if (ret_val < 0) { - mutex_unlock(&dev->lock); - return -EINVAL; - } /* Turn off Master source switch enable */ value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp); value &= 0xFFFFFFDF; ret_val = cx25821_i2c_write(&dev->i2c_bus[0], MON_A_CTRL, value); - - if (ret_val < 0) { - mutex_unlock(&dev->lock); - return -EINVAL; - } + if (ret_val < 0) + goto error; mutex_unlock(&dev->lock); @@ -817,31 +812,25 @@ int medusa_video_init(struct cx25821_dev *dev) value &= 0xFF70FF70; value |= 0x00090008; /* set en_active */ ret_val = cx25821_i2c_write(&dev->i2c_bus[0], DENC_AB_CTRL, value); + if (ret_val < 0) + goto error; - if (ret_val < 0) { - mutex_unlock(&dev->lock); - return -EINVAL; - } /* enable input is VIP/656 */ value = cx25821_i2c_read(&dev->i2c_bus[0], BYP_AB_CTRL, &tmp); value |= 0x00040100; /* enable VIP */ ret_val = cx25821_i2c_write(&dev->i2c_bus[0], BYP_AB_CTRL, value); - if (ret_val < 0) { - mutex_unlock(&dev->lock); - return -EINVAL; - } + if (ret_val < 0) + goto error; + /* select AFE clock to output mode */ value = cx25821_i2c_read(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL, &tmp); value &= 0x83FFFFFF; - ret_val = - cx25821_i2c_write(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL, - value | 0x10000000); + ret_val = cx25821_i2c_write(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL, + value | 0x10000000); + if (ret_val < 0) + goto error; - if (ret_val < 0) { - mutex_unlock(&dev->lock); - return -EINVAL; - } /* Turn on all of the data out and control output pins. */ value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp); value &= 0xFEF0FE00; @@ -868,9 +857,9 @@ int medusa_video_init(struct cx25821_dev *dev) mutex_unlock(&dev->lock); ret_val = medusa_set_videostandard(dev); + return ret_val; - if (ret_val < 0) - return -EINVAL; - - return 1; +error: + mutex_unlock(&dev->lock); + return ret_val; }