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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2021-03-02 14:06:24 +02:00
parent a52eebed20
commit f2067dffed

View file

@ -50,7 +50,7 @@ protected:
int ioctl(unsigned long request, void *argp);
int fd() { return fd_; }
int fd() const { return fd_; }
private:
void listControls();