[3/3] libcamera: v4l2: Remove fromEntityName(MediaDevice*)
diff mbox series

Message ID 20250404074624.2975182-4-paul.elder@ideasonboard.com
State New
Headers show
Series
  • libcamera: pipeline: Use shared pointers for MediaDevice
Related show

Commit Message

Paul Elder April 4, 2025, 7:46 a.m. UTC
From: Kieran Bingham <kieran.bingham@ideasonboard.com>

Now that all users of the fromEntityName() helpers use the shared_ptr
variant, remove the original functions that are no longer used.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 include/libcamera/internal/v4l2_subdevice.h   |  2 --
 include/libcamera/internal/v4l2_videodevice.h |  2 --
 src/libcamera/v4l2_subdevice.cpp              | 17 +----------------
 src/libcamera/v4l2_videodevice.cpp            | 17 +----------------
 4 files changed, 2 insertions(+), 36 deletions(-)

Patch
diff mbox series

diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h
index 08216cd56bc3..1ad21fdc6a27 100644
--- a/include/libcamera/internal/v4l2_subdevice.h
+++ b/include/libcamera/internal/v4l2_subdevice.h
@@ -161,8 +161,6 @@  public:
 	const std::string &model();
 	const V4L2SubdeviceCapability &caps() const { return caps_; }
 
-	static std::unique_ptr<V4L2Subdevice>
-	fromEntityName(const MediaDevice *media, const std::string &entity);
 	static std::unique_ptr<V4L2Subdevice>
 	fromEntityName(std::shared_ptr<const MediaDevice>, const std::string &entity);
 
diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h
index e35fb11bc99f..640990e279e2 100644
--- a/include/libcamera/internal/v4l2_videodevice.h
+++ b/include/libcamera/internal/v4l2_videodevice.h
@@ -226,8 +226,6 @@  public:
 	void setDequeueTimeout(utils::Duration timeout);
 	Signal<> dequeueTimeout;
 
-	static std::unique_ptr<V4L2VideoDevice>
-	fromEntityName(const MediaDevice *media, const std::string &entity);
 	static std::unique_ptr<V4L2VideoDevice>
 	fromEntityName(std::shared_ptr<const MediaDevice>, const std::string &entity);
 
diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
index 13f5316a3fc3..305a1b0f1bae 100644
--- a/src/libcamera/v4l2_subdevice.cpp
+++ b/src/libcamera/v4l2_subdevice.cpp
@@ -1756,7 +1756,7 @@  const std::string &V4L2Subdevice::model()
  * \return A newly created V4L2Subdevice on success, nullptr otherwise
  */
 std::unique_ptr<V4L2Subdevice>
-V4L2Subdevice::fromEntityName(const MediaDevice *media,
+V4L2Subdevice::fromEntityName(std::shared_ptr<const MediaDevice> media,
 			      const std::string &entity)
 {
 	MediaEntity *mediaEntity = media->getEntityByName(entity);
@@ -1766,21 +1766,6 @@  V4L2Subdevice::fromEntityName(const MediaDevice *media,
 	return std::make_unique<V4L2Subdevice>(mediaEntity);
 }
 
-/**
- * \brief Create a new video subdevice instance from \a entity in media device
- * \a media
- * \param[in] media The media device where the entity is registered
- * \param[in] entity The media entity name
- *
- * \return A newly created V4L2Subdevice on success, nullptr otherwise
- */
-std::unique_ptr<V4L2Subdevice>
-V4L2Subdevice::fromEntityName(std::shared_ptr<const MediaDevice> media,
-			      const std::string &entity)
-{
-	return fromEntityName(media.get(), entity);
-}
-
 std::string V4L2Subdevice::logPrefix() const
 {
 	return "'" + entity_->name() + "'";
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index ce7be7deb91f..9769243de8cc 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -2099,7 +2099,7 @@  void V4L2VideoDevice::watchdogExpired()
  * \return A newly created V4L2VideoDevice on success, nullptr otherwise
  */
 std::unique_ptr<V4L2VideoDevice>
-V4L2VideoDevice::fromEntityName(const MediaDevice *media,
+V4L2VideoDevice::fromEntityName(std::shared_ptr<const MediaDevice> media,
 				const std::string &entity)
 {
 	MediaEntity *mediaEntity = media->getEntityByName(entity);
@@ -2109,21 +2109,6 @@  V4L2VideoDevice::fromEntityName(const MediaDevice *media,
 	return std::make_unique<V4L2VideoDevice>(mediaEntity);
 }
 
-/**
- * \brief Create a new video device instance from \a entity in media device
- * \a media
- * \param[in] media The media device where the entity is registered
- * \param[in] entity The media entity name
- *
- * \return A newly created V4L2VideoDevice on success, nullptr otherwise
- */
-std::unique_ptr<V4L2VideoDevice>
-V4L2VideoDevice::fromEntityName(std::shared_ptr<const MediaDevice> media,
-				const std::string &entity)
-{
-	return fromEntityName(media.get(), entity);
-}
-
 /**
  * \brief Convert \a PixelFormat to a V4L2PixelFormat supported by the device
  * \param[in] pixelFormat The PixelFormat to convert