2
0
forked from Ivasoft/DSView

Print the log about failed to open device

This commit is contained in:
dreamsourcelabTAI
2023-06-27 18:32:37 +08:00
parent 25291944b4
commit 7e541f63b1
2 changed files with 4 additions and 4 deletions

View File

@@ -348,8 +348,8 @@ static int hw_dev_open(struct sr_dev_driver *di, struct sr_dev_inst *sdi)
ret = libusb_open(dev_handel, &usb->devhdl);
if (ret != LIBUSB_SUCCESS){
sr_err("%s: Failed to open device: %s, handle:%p",
__func__, libusb_error_name(ret), dev_handel);
sr_err("%s:%d, Failed to open device: %s, handle:%p",
__func__, __LINE__, libusb_error_name(ret), dev_handel);
ds_set_last_error(SR_ERR_DEVICE_IS_EXCLUSIVE);
return SR_ERR;
}

View File

@@ -105,8 +105,8 @@ SR_PRIV int ezusb_upload_firmware(libusb_device *dev, int configuration,
libusb_get_bus_number(dev), libusb_get_device_address(dev));
if ((ret = libusb_open(dev, &hdl)) < 0) {
sr_err("%s: Failed to open device: %s.",
__func__, libusb_error_name(ret));
sr_err("%s:%d, Failed to open device: %s.",
__func__, __LINE__, libusb_error_name(ret));
return SR_ERR;
}