From patchwork Wed Feb 4 15:40:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaac Scott X-Patchwork-Id: 26086 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D0ED4C32E7 for ; Wed, 4 Feb 2026 15:40:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 46CD261FBF; Wed, 4 Feb 2026 16:40:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PdXiz3cN"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7B01061FBF for ; Wed, 4 Feb 2026 16:40:44 +0100 (CET) Received: from t16.ideasonboard.com (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4F9845B2; Wed, 4 Feb 2026 16:40:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1770219602; bh=TTTaEUbGVu4aT2uIDXWQBsEw2JDikLfRVspJa/r0EX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PdXiz3cNLLwPbF7c4sB3UmQjJz1b5uvA7PsDs8vscRzixuobusirpaIvorYn3CEQ3 oe7mwKDFcD9ivixdIBFt3R8RjzEIbvv34c/f8ZFxxGysxrBR4sl+fz723c9Gmn/B9E 6S8dOMHwIiv5I2xmGPKwVQ0U8QbAwgGyuA2vAwfs= From: Isaac Scott To: libcamera-devel@lists.libcamera.org Cc: Isaac Scott Subject: [RFC PATCH 1/1] camera_sensor: Ensure we try multiple camera sensor factories Date: Wed, 4 Feb 2026 15:40:15 +0000 Message-ID: <20260204154015.3755120-2-isaac.scott@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204154015.3755120-1-isaac.scott@ideasonboard.com> References: <20260204154015.3755120-1-isaac.scott@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" CameraSensorFactory::match() should iterate through all available camera sensor factories and in an attempt to find a CameraSensor class that is suitable. Currently, it is implemented in such a way that it will only try the first one before failing. Remove the early return to ensure all CameraSensor factories are checked before returning nullptr. Signed-off-by: Isaac Scott --- src/libcamera/sensor/camera_sensor.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp index 05390d1e1..42407b14b 100644 --- a/src/libcamera/sensor/camera_sensor.cpp +++ b/src/libcamera/sensor/camera_sensor.cpp @@ -479,12 +479,10 @@ std::unique_ptr CameraSensorFactoryBase::create(MediaEntity *entit return std::get>(std::move(result)); } - if (std::get(result)) { + if (std::get(result)) LOG(CameraSensor, Error) << "Failed to create sensor for '" << entity->name() << ": " << std::get(result); - return nullptr; - } } return nullptr;