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>
This commit is contained in:
Kieran Bingham 2024-09-11 23:18:15 +02:00
parent a783562a34
commit 4035f5754e

View file

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