drivers: Print USB error when libusb_claim_interface() fails
https://bugs.freedesktop.org/show_bug.cgi?id=98594
This commit is contained in:
parent
12f6dae8cd
commit
a0bbbd7d32
19 changed files with 26 additions and 21 deletions
|
@ -811,7 +811,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -850,7 +850,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -622,7 +622,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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));
|
aesdev = dev->priv = g_malloc0(sizeof(struct aes3k_dev));
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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));
|
aesdev = dev->priv = g_malloc0(sizeof(struct aes3k_dev));
|
||||||
|
|
||||||
|
|
|
@ -1465,8 +1465,7 @@ static int dev_open(struct fp_img_dev *idev, unsigned long driver_data)
|
||||||
|
|
||||||
ret = libusb_claim_interface(idev->udev, 0);
|
ret = libusb_claim_interface(idev->udev, 0);
|
||||||
if (ret != LIBUSB_SUCCESS) {
|
if (ret != LIBUSB_SUCCESS) {
|
||||||
fp_err("libusb_claim_interface failed on interface 0 "
|
fp_err("libusb_claim_interface failed on interface 0: %s", libusb_error_name(r));
|
||||||
"(err=%d)", ret);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 )
|
//if ( (r = usb_set_configuration(dev->udev, 1)) < 0 )
|
||||||
// goto out;
|
// goto out;
|
||||||
|
|
||||||
if ( (r = libusb_claim_interface(dev->udev, 0)) < 0 )
|
if ( (r = libusb_claim_interface(dev->udev, 0)) < 0 ) {
|
||||||
goto out;
|
fp_err("could not claim interface 0: %s", libusb_error_name(r));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
//if ( (r = usb_set_altinterface(dev->udev, 1)) < 0 )
|
//if ( (r = usb_set_altinterface(dev->udev, 1)) < 0 )
|
||||||
// goto out;
|
// goto out;
|
||||||
|
|
|
@ -864,8 +864,10 @@ static int dev_init(struct fp_dev *dev, unsigned long driver_data)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
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;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
upekdev = g_malloc(sizeof(*upekdev));
|
upekdev = g_malloc(sizeof(*upekdev));
|
||||||
upekdev->seq = 0xf0; /* incremented to 0x00 before first cmd */
|
upekdev->seq = 0xf0; /* incremented to 0x00 before first cmd */
|
||||||
|
|
|
@ -1359,7 +1359,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -441,7 +441,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -651,7 +651,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -875,8 +875,10 @@ static int dev_init(struct fp_dev *dev, unsigned long driver_data)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
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;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
upekdev = g_malloc(sizeof(*upekdev));
|
upekdev = g_malloc(sizeof(*upekdev));
|
||||||
upekdev->seq = 0xf0; /* incremented to 0x00 before first cmd */
|
upekdev->seq = 0xf0; /* incremented to 0x00 before first cmd */
|
||||||
|
|
|
@ -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);
|
r = libusb_claim_interface(dev->udev, iface_desc->bInterfaceNumber);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
fp_err("interface claim failed");
|
fp_err("interface claim failed: %s", libusb_error_name(r));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -348,7 +348,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 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)
|
if (r == 0)
|
||||||
fpi_imgdev_open_complete(dev, 0);
|
fpi_imgdev_open_complete(dev, 0);
|
||||||
|
|
|
@ -1504,7 +1504,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
{
|
{
|
||||||
/* Interface not claimed, return error */
|
/* 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
/* Interface not claimed, return error */
|
/* 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -849,7 +849,7 @@ static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
|
||||||
|
|
||||||
r = libusb_claim_interface(dev->udev, 0);
|
r = libusb_claim_interface(dev->udev, 0);
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
fp_err("Failed to claim interface");
|
fp_err("Failed to claim interface: %s", libusb_error_name(r));
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue