From f2067dffedfe41ab5de62778c478a2add67d5dfb Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 2 Mar 2021 14:06:24 +0200 Subject: libcamera: v4l2_device: Make fd() function const There are use cases for getting the file descriptor of a const V4L2Device instance, for instance to print it in a log. Make the function const. There's little risk of abuse here (as in code then performing operations on the file descriptors that conceptually modify the V4L2 device), as the fd() function is protected. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- include/libcamera/internal/v4l2_device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/libcamera/internal') diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index c56a950e..d006bf68 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -50,7 +50,7 @@ protected: int ioctl(unsigned long request, void *argp); - int fd() { return fd_; } + int fd() const { return fd_; } private: void listControls(); -- cgit v1.2.1