From 560f5cf998646ddc54a20dc1c7326012834d3204 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Mon, 29 Nov 2021 20:38:10 +0200
Subject: libcamera: base: shared_fd: Rename fd() to get()

For consistency with UniqueFD, rename the fd() function to get().
Renaming UniqueFD::get() to fd() would have been another option, but was
rejected to keep as close as possible to the std::shared_ptr<> and
std::unique_ptr<> APIs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
---
 src/cam/drm.cpp   | 4 ++--
 src/cam/image.cpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/cam')

diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp
index f2530091..46e34eb5 100644
--- a/src/cam/drm.cpp
+++ b/src/cam/drm.cpp
@@ -608,12 +608,12 @@ std::unique_ptr<FrameBuffer> Device::createFrameBuffer(
 
 	unsigned int i = 0;
 	for (const libcamera::FrameBuffer::Plane &plane : planes) {
-		int fd = plane.fd.fd();
+		int fd = plane.fd.get();
 		uint32_t handle;
 
 		auto iter = fb->planes_.find(fd);
 		if (iter == fb->planes_.end()) {
-			ret = drmPrimeFDToHandle(fd_, plane.fd.fd(), &handle);
+			ret = drmPrimeFDToHandle(fd_, plane.fd.get(), &handle);
 			if (ret < 0) {
 				ret = -errno;
 				std::cerr
diff --git a/src/cam/image.cpp b/src/cam/image.cpp
index 0180be78..fe2cc6da 100644
--- a/src/cam/image.cpp
+++ b/src/cam/image.cpp
@@ -39,7 +39,7 @@ std::unique_ptr<Image> Image::fromFrameBuffer(const FrameBuffer *buffer, MapMode
 	std::map<int, MappedBufferInfo> mappedBuffers;
 
 	for (const FrameBuffer::Plane &plane : buffer->planes()) {
-		const int fd = plane.fd.fd();
+		const int fd = plane.fd.get();
 		if (mappedBuffers.find(fd) == mappedBuffers.end()) {
 			const size_t length = lseek(fd, 0, SEEK_END);
 			mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };
@@ -61,7 +61,7 @@ std::unique_ptr<Image> Image::fromFrameBuffer(const FrameBuffer *buffer, MapMode
 	}
 
 	for (const FrameBuffer::Plane &plane : buffer->planes()) {
-		const int fd = plane.fd.fd();
+		const int fd = plane.fd.get();
 		auto &info = mappedBuffers[fd];
 		if (!info.address) {
 			void *address = mmap(nullptr, info.mapLength, mmapFlags,
-- 
cgit v1.2.1