From patchwork Wed May 5 15:31:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palash Bandyopadhyay X-Patchwork-Id: 97140 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 o45FnlDg019734 for ; Wed, 5 May 2010 15:49:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932202Ab0EEPtn (ORCPT ); Wed, 5 May 2010 11:49:43 -0400 Received: from cnxtsmtp2.conexant.com ([198.62.9.253]:49100 "EHLO cnxtsmtp2.conexant.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758810Ab0EEPtm convert rfc822-to-8bit (ORCPT ); Wed, 5 May 2010 11:49:42 -0400 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:49:48 +0000 (UTC) X-Greylist: delayed 1074 seconds by postgrey-1.27 at vger.kernel.org; Wed, 05 May 2010 11:49:42 EDT X-WSS-ID: 0L1YDSW-03-028-03 X-M-MSG: Received: from cps (nbwsmx1.bbnet.ad [157.152.183.211]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by cnxtsmtp2.conexant.com (Tumbleweed MailGate 3.7.1) with ESMTP id 2FE4D2463A7 for ; Wed, 5 May 2010 08:31:44 -0700 (PDT) Received: from NBWSMX1.bbnet.ad ([127.0.0.1]) by cps with Microsoft SMTPSVC(6.0.3790.4675); Wed, 5 May 2010 08:31:45 -0700 Received: from cnxthub1.bbnet.ad ([157.152.180.131]) by NBWSMX1.bbnet.ad over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 5 May 2010 08:31:45 -0700 Received: from NBMBX02.bbnet.ad ([fe80:0000:0000:0000:f503:c723:66.76.52.244]) by cnxthub1.bbnet.ad ([157.152.180.131]) with mapi; Wed, 5 May 2010 08:31:45 -0700 From: "Palash Bandyopadhyay" To: "Mauro Carvalho Chehab" , "Dan Carpenter" cc: "Greg Kroah-Hartman" , "linux-media@vger.kernel.org" Date: Wed, 5 May 2010 08:31:39 -0700 Subject: RE: -next: staging/cx25821: please revert 7a02f549fcc Thread-Topic: -next: staging/cx25821: please revert 7a02f549fcc Thread-Index: AcrsZ9g+OJQd9NhzSGKIr5TgfMq18AAAB44w Message-ID: <6CF766271A2E9A4188452BF44FF7131B66DDB6015B@NBMBX02.bbnet.ad> References: <20100505072738.GH27064@bicker> <4BE18EF9.9010502@redhat.com> In-Reply-To: <4BE18EF9.9010502@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US x-tm-as-product-ver: SMEX-8.0.0.1181-6.000.1038-17364.007 x-tm-as-result: No--52.182200-0.000000-31 x-tm-as-user-approved-sender: Yes x-tm-as-user-blocked-sender: No MIME-Version: 1.0 X-OriginalArrivalTime: 05 May 2010 15:31:45.0562 (UTC) FILETIME=[11F6C7A0:01CAEC68] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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; }