Skip to content

Commit

Permalink
Use USB device configuration 1 not 0
Browse files Browse the repository at this point in the history
USB configurations are indexed from 1, not 0. "Configuration 0" means
unconfigured. Linux doesn't allow you to claim an unconfigured device.

See castvoid#4 and castvoid#8.
  • Loading branch information
ryandesign committed Mar 11, 2021
1 parent 00594d6 commit 21632ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hwmond.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define PANEL_VENDOR 0x5ac
#define PANEL_USB_ID 0x8261
#define PANEL_CONFIG 0
#define PANEL_CONFIG 1
#define NUM_LEDS_PER_ROW 8
#define NUM_LED_ROWS 2
#define PANEL_DATA_SIZE 32
Expand Down Expand Up @@ -72,7 +72,7 @@ int setupUSB(libusb_device_handle **frontpanel_device_handle_ptr,
goto fail;
}

libusb_get_config_descriptor(dev, PANEL_CONFIG, &config);
libusb_get_config_descriptor_by_value(dev, PANEL_CONFIG, &config);

// We always choose the first interface
if (config->bNumInterfaces < 1) {
Expand Down

0 comments on commit 21632ec

Please sign in to comment.