v4l2: v4l2_camera_proxy: Use file description in debug messages

Debug messages in V4L2CameraProxy print the numerical file descriptor,
which isn't very human-friendly. Replace it with the V4L2CameraFile
description that includes the full path. While at it, refactor the
messages to use __func__ instead of manually copying function names.

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-12-28 23:36:03 +02:00
parent fc96573697
commit 61670bb338
3 changed files with 56 additions and 33 deletions
+3 -2
View File
@@ -194,7 +194,8 @@ void *V4L2CompatManager::mmap(void *addr, size_t length, int prot, int flags,
if (!file)
return fops_.mmap(addr, length, prot, flags, fd, offset);
void *map = file->proxy()->mmap(addr, length, prot, flags, offset);
void *map = file->proxy()->mmap(file.get(), addr, length, prot, flags,
offset);
if (map == MAP_FAILED)
return map;
@@ -210,7 +211,7 @@ int V4L2CompatManager::munmap(void *addr, size_t length)
V4L2CameraFile *file = device->second.get();
int ret = file->proxy()->munmap(addr, length);
int ret = file->proxy()->munmap(file, addr, length);
if (ret < 0)
return ret;