From patchwork Wed Jun 26 10:13:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1522 Return-Path: Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C9926157F for ; Wed, 26 Jun 2019 12:11:59 +0200 (CEST) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 17AFD24000F; Wed, 26 Jun 2019 10:11:58 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 26 Jun 2019 12:13:08 +0200 Message-Id: <20190626101308.19099-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: v4l2_device: Fix control enumeration bug 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: Wed, 26 Jun 2019 10:11:59 -0000 When enumerating the available V4L2 controls at video device open time set the V4L2_CTRL_FLAG_NEXT_CTRL flag when hitting an unsupported control type not to loop forever. While at it, downgrade the message reporting the control type in not supported to Debug, as it is not an error worth being reported unconditionally. Fixes: 030ce6491ed3 ("libcamera: v4l2_device: List valid controls at open") Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart Reviewed-by: Laurent Pinchart --- src/libcamera/v4l2_device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 84758a811c27..13d4bce5c013 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -341,8 +341,9 @@ void V4L2Device::listControls() break; /* \todo Support compound controls. */ default: - LOG(V4L2, Error) << "Control type '" << info.type() + LOG(V4L2, Debug) << "Control type '" << info.type() << "' not supported"; + ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL; continue; }