From patchwork Mon Jan 21 11:41:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 292 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7459860C7F for ; Mon, 21 Jan 2019 12:41:30 +0100 (CET) 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 E9E4641; Mon, 21 Jan 2019 12:41:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1548070890; bh=lsOBty2q/V1Y0/EHq36SGgmBv2juJBnIgUXXFJdPucA=; h=From:To:Cc:Subject:Date:From; b=jDctejC7lyjJqVPfp19trWMg/dADjVPleHAI+BPmpkUC/aGMOqL754N1AmqO3WpV+ 870KjO1ZfRwNZ8gwgNSMH0nzsVK09t9+5KYgslPV5wyEt2NXmAPUufIbY3ncXNEXu+ 8rnzI+0Q5zst/2rW1XEWCbFfLW30B8LGD+DQHqjQ= From: Kieran Bingham To: LibCamera Devel Date: Mon, 21 Jan 2019 11:41:26 +0000 Message-Id: <20190121114126.19577-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH] libcamera: camera_manager: Return EBUSY if enumerator exists 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: Mon, 21 Jan 2019 11:41:30 -0000 In the case that someone calls CameraManager::start() and it has already started/enumerated, instead of returning -ENODEV, return -EBUSY. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/camera_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index d76eaa7ace86..21cb36dcb9b5 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -76,7 +76,7 @@ CameraManager::~CameraManager() int CameraManager::start() { if (enumerator_) - return -ENODEV; + return -EBUSY; enumerator_ = DeviceEnumerator::create(); if (enumerator_->enumerate())