mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 21:28:50 +00:00
st/prober: If we can't tell if we can open a device assume yes
This commit is contained in:
parent
8af3a47f5a
commit
59fccb0c38
|
@ -1140,13 +1140,23 @@ p_can_open(struct xrt_prober *xp, struct xrt_prober_device *xpdev)
|
||||||
{
|
{
|
||||||
XRT_TRACE_MARKER();
|
XRT_TRACE_MARKER();
|
||||||
|
|
||||||
XRT_MAYBE_UNUSED struct prober *p = (struct prober *)xp;
|
struct prober *p = (struct prober *)xp;
|
||||||
XRT_MAYBE_UNUSED struct prober_device *pdev = (struct prober_device *)xpdev;
|
struct prober_device *pdev = (struct prober_device *)xpdev;
|
||||||
|
bool has_been_queried = false;
|
||||||
|
|
||||||
#ifdef XRT_HAVE_LIBUSB
|
#ifdef XRT_HAVE_LIBUSB
|
||||||
|
has_been_queried = true;
|
||||||
if (pdev->usb.dev != NULL) {
|
if (pdev->usb.dev != NULL) {
|
||||||
return p_libusb_can_open(p, pdev);
|
return p_libusb_can_open(p, pdev);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// No backend compiled in to judge the ability to open the device.
|
||||||
|
if (!has_been_queried) {
|
||||||
|
P_WARN(p, "Can not tell if '%s' can be opened, assuming yes!", pdev->usb.product);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//! @todo add more backends
|
//! @todo add more backends
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue