drivers: Print USB error when libusb_claim_interface() fails

https://bugs.freedesktop.org/show_bug.cgi?id=98594
This commit is contained in:
Bastien Nocera 2016-11-05 00:10:17 +01:00
parent 12f6dae8cd
commit a0bbbd7d32
19 changed files with 26 additions and 21 deletions

View file

@ -811,7 +811,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -53,7 +53,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -850,7 +850,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -622,7 +622,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -53,7 +53,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -131,7 +131,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0)
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
aesdev = dev->priv = g_malloc0(sizeof(struct aes3k_dev));

View file

@ -128,7 +128,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0)
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
aesdev = dev->priv = g_malloc0(sizeof(struct aes3k_dev));

View file

@ -1465,8 +1465,7 @@ static int dev_open(struct fp_img_dev *idev, unsigned long driver_data)
ret = libusb_claim_interface(idev->udev, 0);
if (ret != LIBUSB_SUCCESS) {
fp_err("libusb_claim_interface failed on interface 0 "
"(err=%d)", ret);
fp_err("libusb_claim_interface failed on interface 0: %s", libusb_error_name(r));
return ret;
}

View file

@ -264,8 +264,10 @@ gint dev_init(struct fp_img_dev *dev, unsigned long driver_data)
//if ( (r = usb_set_configuration(dev->udev, 1)) < 0 )
// goto out;
if ( (r = libusb_claim_interface(dev->udev, 0)) < 0 )
goto out;
if ( (r = libusb_claim_interface(dev->udev, 0)) < 0 ) {
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}
//if ( (r = usb_set_altinterface(dev->udev, 1)) < 0 )
// goto out;

View file

@ -864,8 +864,10 @@ static int dev_init(struct fp_dev *dev, unsigned long driver_data)
int r;
r = libusb_claim_interface(dev->udev, 0);
if (r < 0)
if (r < 0) {
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}
upekdev = g_malloc(sizeof(*upekdev));
upekdev->seq = 0xf0; /* incremented to 0x00 before first cmd */

View file

@ -1359,7 +1359,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -441,7 +441,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -651,7 +651,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -875,8 +875,10 @@ static int dev_init(struct fp_dev *dev, unsigned long driver_data)
int r;
r = libusb_claim_interface(dev->udev, 0);
if (r < 0)
if (r < 0) {
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}
upekdev = g_malloc(sizeof(*upekdev));
upekdev->seq = 0xf0; /* incremented to 0x00 before first cmd */

View file

@ -1285,7 +1285,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, iface_desc->bInterfaceNumber);
if (r < 0) {
fp_err("interface claim failed");
fp_err("interface claim failed: %s", libusb_error_name(r));
goto out;
}

View file

@ -348,7 +348,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0)
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
if (r == 0)
fpi_imgdev_open_complete(dev, 0);

View file

@ -1504,7 +1504,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
if (r < 0)
{
/* Interface not claimed, return error */
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -240,7 +240,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r < 0) {
/* Interface not claimed, return error */
fp_err("could not claim interface 0");
fp_err("could not claim interface 0: %s", libusb_error_name(r));
return r;
}

View file

@ -849,7 +849,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
r = libusb_claim_interface(dev->udev, 0);
if (r != 0) {
fp_err("Failed to claim interface");
fp_err("Failed to claim interface: %s", libusb_error_name(r));
return r;
}