libcamera: media_device: Print link information when setup fails

When setting up a link fails, the error message doesn't specify which
link is being acted on. This makes debugging more difficult than it
should be. Improve the message by printing the link information.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2021-08-30 02:44:21 +03:00
parent 1526650fc7
commit 211d6f5ca6

View file

@ -803,7 +803,11 @@ int MediaDevice::setupLink(const MediaLink *link, unsigned int flags)
if (ret) {
ret = -errno;
LOG(MediaDevice, Error)
<< "Failed to setup link: "
<< "Failed to setup link "
<< source->entity()->name() << "["
<< source->index() << "] -> "
<< sink->entity()->name() << "["
<< sink->index() << "]: "
<< strerror(-ret);
return ret;
}