mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
usb: remove fallback to bNumInterfaces if no .nif
All callers have been updated. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
add750882f
commit
fef13fa8e4
1 changed files with 2 additions and 3 deletions
|
@ -76,7 +76,7 @@ int usb_desc_config(const USBDescConfig *conf, uint8_t *dest, size_t len)
|
||||||
{
|
{
|
||||||
uint8_t bLength = 0x09;
|
uint8_t bLength = 0x09;
|
||||||
uint16_t wTotalLength = 0;
|
uint16_t wTotalLength = 0;
|
||||||
int i, rc, count;
|
int i, rc;
|
||||||
|
|
||||||
if (len < bLength) {
|
if (len < bLength) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -91,8 +91,7 @@ int usb_desc_config(const USBDescConfig *conf, uint8_t *dest, size_t len)
|
||||||
dest[0x08] = conf->bMaxPower;
|
dest[0x08] = conf->bMaxPower;
|
||||||
wTotalLength += bLength;
|
wTotalLength += bLength;
|
||||||
|
|
||||||
count = conf->nif ? conf->nif : conf->bNumInterfaces;
|
for (i = 0; i < conf->nif; i++) {
|
||||||
for (i = 0; i < count; i++) {
|
|
||||||
rc = usb_desc_iface(conf->ifs + i, dest + wTotalLength, len - wTotalLength);
|
rc = usb_desc_iface(conf->ifs + i, dest + wTotalLength, len - wTotalLength);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue