From patchwork Thu Aug 8 15:12:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 1751 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AB4AF615FF for ; Thu, 8 Aug 2019 17:12:26 +0200 (CEST) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3FE39737; Thu, 8 Aug 2019 17:12:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1565277146; bh=6OcXaBu06vIo4/eSMUUCV+xbOCseODISKxS5nz5B62g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kGMQ4G3FB5h/bwpUJbp2HGlr4Vf2DWBvsodWBlQwilVjsJPHBeWmsmGr00a27dnHX grjI5seyF0jQvi4jePDQx9sgPWILCSE37+y+dy90Qnyg06c3TQjidKi1OJfZzy73OX tsKsap8cf5w+JBBfLLZJ5KDEOcgiOW4tAgE0hmRU= From: Kieran Bingham To: LibCamera Devel Date: Thu, 8 Aug 2019 16:12:17 +0100 Message-Id: <20190808151221.24254-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190808151221.24254-1-kieran.bingham@ideasonboard.com> References: <20190808151221.24254-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/6] libcamera: v4l2_videodevice: Fix ordering of debug statement X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 15:12:26 -0000 The "Opened device" statement occurs before the buffertype_ is set. This causes all devices to report that they are [out] devices at open() regardless of their type. As the message operates in the past-tense, move the statement to the end of the function when all work has been completed. Fixes: 04d5be7f76fe ("libcamera: v4l2_device: Inherit from Loggable to print device node name") Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/libcamera/v4l2_videodevice.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index c43d7cc557a0..81098dd70190 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -314,10 +314,6 @@ int V4L2VideoDevice::open() return ret; } - LOG(V4L2, Debug) - << "Opened device " << caps_.bus_info() << ": " - << caps_.driver() << ": " << caps_.card(); - if (!caps_.hasStreaming()) { LOG(V4L2, Error) << "Device does not support streaming I/O"; return -EINVAL; @@ -352,6 +348,10 @@ int V4L2VideoDevice::open() fdEvent_->activated.connect(this, &V4L2VideoDevice::bufferAvailable); fdEvent_->setEnabled(false); + LOG(V4L2, Debug) + << "Opened device " << caps_.bus_info() << ": " + << caps_.driver() << ": " << caps_.card(); + return 0; }