if (WARN_ON(data_size < sizeof(*line6)))
return -EINVAL;
+ /* we don't handle multiple configurations */
+ if (usbdev->descriptor.bNumConfigurations != 1)
+ return -ENODEV;
+
ret = snd_card_new(&interface->dev,
SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
THIS_MODULE, data_size, &card);
line6->usbdev = usbdev;
line6->ifcdev = &interface->dev;
- strcpy(card->id, line6->properties->id);
+ strcpy(card->id, properties->id);
strcpy(card->driver, DRIVER_NAME);
- strcpy(card->shortname, line6->properties->name);
- sprintf(card->longname, "Line 6 %s at USB %s", line6->properties->name,
+ strcpy(card->shortname, properties->name);
+ sprintf(card->longname, "Line 6 %s at USB %s", properties->name,
dev_name(line6->ifcdev));
card->private_free = line6_destruct;
/* increment reference counters: */
usb_get_dev(usbdev);
- /* we don't handle multiple configurations */
- if (usbdev->descriptor.bNumConfigurations != 1) {
- ret = -ENODEV;
- goto error;
- }
-
/* initialize device info: */
dev_info(&interface->dev, "Line 6 %s found\n", properties->name);
interface_number = interface->cur_altsetting->desc.bInterfaceNumber;
ret = usb_set_interface(usbdev, interface_number,
- properties->altsetting);
+ properties->altsetting);
if (ret < 0) {
dev_err(&interface->dev, "set_interface failed\n");
goto error;
/* creation of additional special files should go here */
dev_info(&interface->dev, "Line 6 %s now attached\n",
- line6->properties->name);
+ properties->name);
return 0;