diff options
Diffstat (limited to 'drivers/usb/gadget/gmidi.c')
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 60d3f9e9b51f..b9312dc6e041 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -199,10 +199,10 @@ DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(1); | |||
199 | static struct usb_device_descriptor device_desc = { | 199 | static struct usb_device_descriptor device_desc = { |
200 | .bLength = USB_DT_DEVICE_SIZE, | 200 | .bLength = USB_DT_DEVICE_SIZE, |
201 | .bDescriptorType = USB_DT_DEVICE, | 201 | .bDescriptorType = USB_DT_DEVICE, |
202 | .bcdUSB = __constant_cpu_to_le16(0x0200), | 202 | .bcdUSB = cpu_to_le16(0x0200), |
203 | .bDeviceClass = USB_CLASS_PER_INTERFACE, | 203 | .bDeviceClass = USB_CLASS_PER_INTERFACE, |
204 | .idVendor = __constant_cpu_to_le16(DRIVER_VENDOR_NUM), | 204 | .idVendor = cpu_to_le16(DRIVER_VENDOR_NUM), |
205 | .idProduct = __constant_cpu_to_le16(DRIVER_PRODUCT_NUM), | 205 | .idProduct = cpu_to_le16(DRIVER_PRODUCT_NUM), |
206 | .iManufacturer = STRING_MANUFACTURER, | 206 | .iManufacturer = STRING_MANUFACTURER, |
207 | .iProduct = STRING_PRODUCT, | 207 | .iProduct = STRING_PRODUCT, |
208 | .bNumConfigurations = 1, | 208 | .bNumConfigurations = 1, |
@@ -241,8 +241,8 @@ static const struct usb_ac_header_descriptor_1 ac_header_desc = { | |||
241 | .bLength = USB_DT_AC_HEADER_SIZE(1), | 241 | .bLength = USB_DT_AC_HEADER_SIZE(1), |
242 | .bDescriptorType = USB_DT_CS_INTERFACE, | 242 | .bDescriptorType = USB_DT_CS_INTERFACE, |
243 | .bDescriptorSubtype = USB_MS_HEADER, | 243 | .bDescriptorSubtype = USB_MS_HEADER, |
244 | .bcdADC = __constant_cpu_to_le16(0x0100), | 244 | .bcdADC = cpu_to_le16(0x0100), |
245 | .wTotalLength = __constant_cpu_to_le16(USB_DT_AC_HEADER_SIZE(1)), | 245 | .wTotalLength = cpu_to_le16(USB_DT_AC_HEADER_SIZE(1)), |
246 | .bInCollection = 1, | 246 | .bInCollection = 1, |
247 | .baInterfaceNr = { | 247 | .baInterfaceNr = { |
248 | [0] = GMIDI_MS_INTERFACE, | 248 | [0] = GMIDI_MS_INTERFACE, |
@@ -265,8 +265,8 @@ static const struct usb_ms_header_descriptor ms_header_desc = { | |||
265 | .bLength = USB_DT_MS_HEADER_SIZE, | 265 | .bLength = USB_DT_MS_HEADER_SIZE, |
266 | .bDescriptorType = USB_DT_CS_INTERFACE, | 266 | .bDescriptorType = USB_DT_CS_INTERFACE, |
267 | .bDescriptorSubtype = USB_MS_HEADER, | 267 | .bDescriptorSubtype = USB_MS_HEADER, |
268 | .bcdMSC = __constant_cpu_to_le16(0x0100), | 268 | .bcdMSC = cpu_to_le16(0x0100), |
269 | .wTotalLength = __constant_cpu_to_le16(USB_DT_MS_HEADER_SIZE | 269 | .wTotalLength = cpu_to_le16(USB_DT_MS_HEADER_SIZE |
270 | + 2*USB_DT_MIDI_IN_SIZE | 270 | + 2*USB_DT_MIDI_IN_SIZE |
271 | + 2*USB_DT_MIDI_OUT_SIZE(1)), | 271 | + 2*USB_DT_MIDI_OUT_SIZE(1)), |
272 | }; | 272 | }; |
@@ -1099,10 +1099,9 @@ static int gmidi_register_card(struct gmidi_device *dev) | |||
1099 | .dev_free = gmidi_snd_free, | 1099 | .dev_free = gmidi_snd_free, |
1100 | }; | 1100 | }; |
1101 | 1101 | ||
1102 | card = snd_card_new(index, id, THIS_MODULE, 0); | 1102 | err = snd_card_create(index, id, THIS_MODULE, 0, &card); |
1103 | if (!card) { | 1103 | if (err < 0) { |
1104 | ERROR(dev, "snd_card_new failed\n"); | 1104 | ERROR(dev, "snd_card_create failed\n"); |
1105 | err = -ENOMEM; | ||
1106 | goto fail; | 1105 | goto fail; |
1107 | } | 1106 | } |
1108 | dev->card = card; | 1107 | dev->card = card; |
@@ -1227,7 +1226,7 @@ autoconf_fail: | |||
1227 | */ | 1226 | */ |
1228 | pr_warning("%s: controller '%s' not recognized\n", | 1227 | pr_warning("%s: controller '%s' not recognized\n", |
1229 | shortname, gadget->name); | 1228 | shortname, gadget->name); |
1230 | device_desc.bcdDevice = __constant_cpu_to_le16(0x9999); | 1229 | device_desc.bcdDevice = cpu_to_le16(0x9999); |
1231 | } | 1230 | } |
1232 | 1231 | ||
1233 | 1232 | ||