Skip to content

Commit

Permalink
Merge pull request OpenKinect#270 from jdcole/partial_driver_install_…
Browse files Browse the repository at this point in the history
…error

Added error reporting for failed subdevice initialization (@jdcole)

Reviewed-by: Benn Snyder <[email protected]>
  • Loading branch information
piedar committed Nov 16, 2013
2 parents 5eed1f0 + f13ffdb commit c55f3c9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/usb_libusb10.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,23 @@ FN_INTERNAL int fnusb_open_subdevices(freenect_device *dev, int index)
if (dev->usb_cam.dev) {
libusb_release_interface(dev->usb_cam.dev, 0);
libusb_close(dev->usb_cam.dev);
} else {
FN_ERROR("Failed to open camera subdevice or it is not disabled.");
}

if (dev->usb_motor.dev) {
libusb_release_interface(dev->usb_motor.dev, 0);
libusb_close(dev->usb_motor.dev);
} else {
FN_ERROR("Failed to open motor subddevice or it is not disabled.");
}

#ifdef BUILD_AUDIO
if (dev->usb_audio.dev) {
libusb_release_interface(dev->usb_audio.dev, 0);
libusb_close(dev->usb_audio.dev);
} else {
FN_ERROR("Failed to open audio subdevice or it is not disabled.");
}
#endif
return -1;
Expand Down

0 comments on commit c55f3c9

Please sign in to comment.