summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2024-09-11 23:18:15 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-09-12 12:01:29 +0200
commit4035f5754e1dd6a857b86c183d5d344353e16b2c (patch)
treebc59e364a9809891c21240a3ae99c35fcd383dee
parenta783562a34893fb1f96fea4ba6584d8e8e61d9b2 (diff)
libcamera: media_device: Use MediaLink string helper
Replace the two open-coded implementations of a link representation with the operator<< overload string representation to simplify the code and unify appearance of reporting MediaLinks. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/libcamera/media_device.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index bd054552..d71dad74 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -818,20 +818,12 @@ int MediaDevice::setupLink(const MediaLink *link, unsigned int flags)
if (ret) {
ret = -errno;
LOG(MediaDevice, Error)
- << "Failed to setup link "
- << source->entity()->name() << "["
- << source->index() << "] -> "
- << sink->entity()->name() << "["
- << sink->index() << "]: "
+ << "Failed to setup link " << *link << ": "
<< strerror(-ret);
return ret;
}
- LOG(MediaDevice, Debug)
- << source->entity()->name() << "["
- << source->index() << "] -> "
- << sink->entity()->name() << "["
- << sink->index() << "]: " << flags;
+ LOG(MediaDevice, Debug) << *link << ": " << flags;
return 0;
}