From patchwork Thu Aug 12 20:32:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 119325 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7CKXBG8030463 for ; Thu, 12 Aug 2010 20:33:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760557Ab0HLUdJ (ORCPT ); Thu, 12 Aug 2010 16:33:09 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:48400 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1754740Ab0HLUdI (ORCPT ); Thu, 12 Aug 2010 16:33:08 -0400 Received: (qmail invoked by alias); 12 Aug 2010 20:33:00 -0000 Received: from p57BD0AB3.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.10.179] by mail.gmx.net (mp057) with SMTP; 12 Aug 2010 22:33:00 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1/3rkcjizH3ipWvyI1MJO+petAdPFRMoJ0QmNhJ8Y aiHfl8bbZ1yzOF Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OjeSR-0005AH-AY; Thu, 12 Aug 2010 22:32:59 +0200 Date: Thu, 12 Aug 2010 22:32:59 +0200 (CEST) From: Guennadi Liakhovetski To: Linux Media Mailing List cc: Janusz Krzysztofik Subject: [PATCH] soc-camera: initialise videobuf immediately before allocating them Message-ID: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 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, 12 Aug 2010 20:33:12 +0000 (UTC) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index a499cac..d90386c 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -158,6 +158,8 @@ static int soc_camera_reqbufs(struct file *file, void *priv, WARN_ON(priv != file->private_data); + ici->ops->init_videobuf(&icf->vb_vidq, icd); + ret = videobuf_reqbufs(&icf->vb_vidq, p); if (ret < 0) return ret; @@ -409,8 +411,6 @@ static int soc_camera_open(struct file *file) file->private_data = icf; dev_dbg(&icd->dev, "camera device open\n"); - ici->ops->init_videobuf(&icf->vb_vidq, icd); - mutex_unlock(&icd->video_lock); return 0;