Commit 2671461b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: changes due to struct usb_interface changing from a pointer to an array of pointers.

parent 9b32d10e
......@@ -621,7 +621,7 @@ static void cpia_disconnect(struct usb_interface *intf)
udev = interface_to_usbdev(intf);
usb_driver_release_interface(&cpia_driver,
&udev->actconfig->interface[0]);
udev->actconfig->interface[0]);
ucpia->curbuff = ucpia->workbuff = NULL;
......
......@@ -1524,7 +1524,7 @@ static int set_format_in(struct usb_audiodev *as)
if (u->interface < 0 || u->interface >= config->desc.bNumInterfaces)
return 0;
iface = &config->interface[u->interface];
iface = config->interface[u->interface];
fmtnr = find_format(as->fmtin, as->numfmtin, d->format, d->srate);
if (fmtnr < 0) {
......@@ -1612,7 +1612,7 @@ static int set_format_out(struct usb_audiodev *as)
if (u->interface < 0 || u->interface >= config->desc.bNumInterfaces)
return 0;
iface = &config->interface[u->interface];
iface = config->interface[u->interface];
fmtnr = find_format(as->fmtout, as->numfmtout, d->format, d->srate);
if (fmtnr < 0) {
......@@ -2704,7 +2704,7 @@ static int usb_audio_release(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE) {
usbout_stop(as);
if (dev && as->usbout.interface >= 0) {
iface = &dev->actconfig->interface[as->usbout.interface];
iface = dev->actconfig->interface[as->usbout.interface];
usb_set_interface(dev, iface->altsetting->desc.bInterfaceNumber, 0);
}
dmabuf_release(&as->usbout.dma);
......@@ -2713,7 +2713,7 @@ static int usb_audio_release(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_READ) {
usbin_stop(as);
if (dev && as->usbin.interface >= 0) {
iface = &dev->actconfig->interface[as->usbin.interface];
iface = dev->actconfig->interface[as->usbin.interface];
usb_set_interface(dev, iface->altsetting->desc.bInterfaceNumber, 0);
}
dmabuf_release(&as->usbin.dma);
......@@ -2866,7 +2866,7 @@ static void usb_audio_parsestreaming(struct usb_audio_state *s, unsigned char *b
/* search for input formats */
if (asifin >= 0) {
as->usbin.flags = FLG_CONNECTED;
iface = &config->interface[asifin];
iface = config->interface[asifin];
for (i = 0; i < iface->num_altsetting; i++) {
alts = &iface->altsetting[i];
if (alts->desc.bInterfaceClass != USB_CLASS_AUDIO || alts->desc.bInterfaceSubClass != 2)
......@@ -2947,7 +2947,7 @@ static void usb_audio_parsestreaming(struct usb_audio_state *s, unsigned char *b
/* search for output formats */
if (asifout >= 0) {
as->usbout.flags = FLG_CONNECTED;
iface = &config->interface[asifout];
iface = config->interface[asifout];
for (i = 0; i < iface->num_altsetting; i++) {
alts = &iface->altsetting[i];
if (alts->desc.bInterfaceClass != USB_CLASS_AUDIO || alts->desc.bInterfaceSubClass != 2)
......@@ -3684,7 +3684,7 @@ static struct usb_audio_state *usb_audio_parsecontrol(struct usb_device *dev, un
dev->devnum, ctrlif, j);
continue;
}
iface = &config->interface[j];
iface = config->interface[j];
if (iface->altsetting[0].desc.bInterfaceClass != USB_CLASS_AUDIO) {
printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u interface %u is not an AudioClass interface\n",
dev->devnum, ctrlif, j);
......
......@@ -560,16 +560,16 @@ static int acm_probe (struct usb_interface *intf,
for (j = 0; j < cfacm->desc.bNumInterfaces - 1; j++) {
if (usb_interface_claimed(cfacm->interface + j) ||
usb_interface_claimed(cfacm->interface + j + 1))
if (usb_interface_claimed(cfacm->interface[j]) ||
usb_interface_claimed(cfacm->interface[j + 1]))
continue;
ifcom = cfacm->interface[j].altsetting + 0;
ifdata = cfacm->interface[j + 1].altsetting + 0;
ifcom = cfacm->interface[j]->altsetting + 0;
ifdata = cfacm->interface[j + 1]->altsetting + 0;
if (ifdata->desc.bInterfaceClass != 10 || ifdata->desc.bNumEndpoints < 2) {
ifcom = cfacm->interface[j + 1].altsetting + 0;
ifdata = cfacm->interface[j].altsetting + 0;
ifcom = cfacm->interface[j + 1]->altsetting + 0;
ifdata = cfacm->interface[j]->altsetting + 0;
if (ifdata->desc.bInterfaceClass != 10 || ifdata->desc.bNumEndpoints < 2)
continue;
}
......@@ -610,7 +610,7 @@ static int acm_probe (struct usb_interface *intf,
ctrlsize = epctrl->wMaxPacketSize;
readsize = epread->wMaxPacketSize;
acm->writesize = epwrite->wMaxPacketSize;
acm->iface = cfacm->interface + j;
acm->iface = cfacm->interface[j];
acm->minor = minor;
acm->dev = dev;
......
......@@ -1524,10 +1524,10 @@ static int get_alt_setting( struct usb_device *d, int ifnum )
int epin, epout;
int i;
alts = d->actconfig->interface[ifnum].num_altsetting;
alts = d->actconfig->interface[ifnum]->num_altsetting;
for ( alt=0 ; alt<alts ; alt++ ) {
interface = &d->actconfig->interface[ifnum].altsetting[alt];
interface = &d->actconfig->interface[ifnum]->altsetting[alt];
epin = -1;
epout = -1;
......@@ -1795,8 +1795,8 @@ static int detect_yamaha_device( struct usb_device *d, unsigned int ifnum, struc
return -EINVAL;
}
for ( i=0 ; i < c->interface[ifnum].num_altsetting; i++ ) {
interface = c->interface[ifnum].altsetting + i;
for ( i=0 ; i < c->interface[ifnum]->num_altsetting; i++ ) {
interface = c->interface[ifnum]->altsetting + i;
if ( interface->desc.bInterfaceClass != 255 ||
interface->desc.bInterfaceSubClass != 0 )
......@@ -1889,8 +1889,8 @@ static int detect_midi_subclass(struct usb_device *d, unsigned int ifnum, struct
int alts=-1;
int ret;
for ( i=0 ; i < c->interface[ifnum].num_altsetting; i++ ) {
interface = c->interface[ifnum].altsetting + i;
for ( i=0 ; i < c->interface[ifnum]->num_altsetting; i++ ) {
interface = c->interface[ifnum]->altsetting + i;
if ( interface->desc.bInterfaceClass != USB_CLASS_AUDIO ||
interface->desc.bInterfaceSubClass != USB_SUBCLASS_MIDISTREAMING )
......
......@@ -966,7 +966,7 @@ static int usblp_select_alts(struct usblp *usblp)
struct usb_endpoint_descriptor *epd, *epwrite, *epread;
int p, i, e;
if_alt = &usblp->dev->actconfig->interface[usblp->ifnum];
if_alt = usblp->dev->actconfig->interface[usblp->ifnum];
for (p = 0; p < USBLP_MAX_PROTOCOLS; p++)
usblp->protocol[p].alt_setting = -1;
......
......@@ -37,7 +37,7 @@ static void usb_show_config(struct usb_host_config *config)
usb_show_config_descriptor(&config->desc);
for (i = 0; i < config->desc.bNumInterfaces; i++) {
ifp = config->interface + i;
ifp = config->interface[i];
if (!ifp)
break;
......
......@@ -847,7 +847,7 @@ static void destroy_scanner (struct kobject *kobj)
down (&(scn->sem));
usb_driver_release_interface(&scanner_driver,
&scn->scn_dev->actconfig->interface[scn->ifnum]);
scn->scn_dev->actconfig->interface[scn->ifnum]);
kfree(scn->ibuf);
kfree(scn->obuf);
......
......@@ -3718,7 +3718,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id *
} while (0);
/* Validate found interface: must have one ISO endpoint */
nas = dev->actconfig->interface[ifnum].num_altsetting;
nas = dev->actconfig->interface[ifnum]->num_altsetting;
if (debug > 0)
info("Number of alternate settings=%d.", nas);
if (nas < 2) {
......@@ -3730,7 +3730,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id *
const struct usb_host_interface *interface;
const struct usb_endpoint_descriptor *endpoint;
interface = &dev->actconfig->interface[ifnum].altsetting[i];
interface = &dev->actconfig->interface[ifnum]->altsetting[i];
if (interface->desc.bNumEndpoints != 1) {
err("Interface %d. has %u. endpoints!",
ifnum, (unsigned)(interface->desc.bNumEndpoints));
......
......@@ -383,7 +383,7 @@ static int konicawc_start_data(struct uvd *uvd)
int pktsz;
struct usb_host_interface *interface;
interface = &dev->actconfig->interface[uvd->iface].altsetting[spd_to_iface[cam->speed]];
interface = &dev->actconfig->interface[uvd->iface]->altsetting[spd_to_iface[cam->speed]];
pktsz = interface->endpoint[1].desc.wMaxPacketSize;
DEBUG(1, "pktsz = %d", pktsz);
if (!CAMERA_IS_OPERATIONAL(uvd)) {
......
......@@ -6088,7 +6088,7 @@ ov518_configure(struct usb_ov511 *ov)
if (ov->bridge == BRG_OV518)
{
struct usb_interface *ifp = &ov->dev->config[0].interface[0];
struct usb_interface *ifp = ov->dev->config[0].interface[0];
__u16 mxps = ifp->altsetting[7].endpoint[0].desc.wMaxPacketSize;
/* Some OV518s have packet numbering by default, some don't */
......
......@@ -796,7 +796,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
/* Get the current alternate interface, adjust packet size */
if (!udev->actconfig)
return -EFAULT;
idesc = &udev->actconfig->interface[0].altsetting[pdev->valternate];
idesc = &udev->actconfig->interface[0]->altsetting[pdev->valternate];
if (!idesc)
return -EFAULT;
......
......@@ -289,7 +289,7 @@ brlvger_probe (struct usb_interface *intf,
we reserve it.*/
static DECLARE_MUTEX(reserve_sem);
actifsettings = dev->actconfig->interface->altsetting;
actifsettings = dev->actconfig->interface[0]->altsetting;
if( dev->descriptor.bNumConfigurations != 1
|| dev->config->desc.bNumInterfaces != 1
......
......@@ -547,7 +547,7 @@ static int cdc_bind (struct usbnet *dev, struct usb_interface *intf)
d = &intf->altsetting->desc;
if (info->u->bMasterInterface0 != d->bInterfaceNumber)
goto bad_desc;
info->data = dev->udev->actconfig->interface;
info->data = dev->udev->actconfig->interface[0];
if (intf != (info->data + info->u->bMasterInterface0))
goto bad_desc;
......
......@@ -993,7 +993,7 @@ static int TIDownloadFirmware (struct edgeport_serial *serial)
if (status)
return status;
interface = &serial->serial->dev->config->interface->altsetting->desc;
interface = &serial->serial->dev->config->interface[0]->altsetting->desc;
if (!interface) {
dev_err (&serial->serial->dev->dev, "%s - no interface set, error!", __FUNCTION__);
return -ENODEV;
......
......@@ -182,7 +182,7 @@ static int kobil_startup (struct usb_serial *serial)
// search for the necessary endpoints
pdev = serial->dev;
actconfig = pdev->actconfig;
interface = actconfig->interface;
interface = actconfig->interface[0];
altsetting = interface->altsetting;
endpoint = altsetting->endpoint;
......
......@@ -1055,9 +1055,9 @@ int usb_serial_probe(struct usb_interface *interface,
(dev->descriptor.idProduct == PL2303_PRODUCT_ID)) ||
((dev->descriptor.idVendor == ATEN_VENDOR_ID) &&
(dev->descriptor.idProduct == ATEN_PRODUCT_ID))) {
if (interface != &dev->actconfig->interface[0]) {
if (interface != dev->actconfig->interface[0]) {
/* check out the endpoints of the other interface*/
iface_desc = &dev->actconfig->interface[0].altsetting[0];
iface_desc = &dev->actconfig->interface[0]->altsetting[0];
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
endpoint = &iface_desc->endpoint[i].desc;
if ((endpoint->bEndpointAddress & 0x80) &&
......
......@@ -1061,7 +1061,7 @@ static int set_format(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
return -EINVAL;
}
iface = &config->interface[fmt->iface];
iface = config->interface[fmt->iface];
alts = &iface->altsetting[fmt->altset_idx];
altsd = get_iface_desc(alts);
snd_assert(altsd->bAlternateSetting == fmt->altsetting, return -EINVAL);
......@@ -2156,7 +2156,7 @@ static int parse_audio_endpoints(snd_usb_audio_t *chip, int iface_no)
config = dev->actconfig;
/* parse the interface's altsettings */
iface = &config->interface[iface_no];
iface = config->interface[iface_no];
for (i = 0; i < iface->num_altsetting; i++) {
alts = &iface->altsetting[i];
altsd = get_iface_desc(alts);
......@@ -2291,7 +2291,7 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif)
/* find audiocontrol interface */
config = dev->actconfig;
host_iface = &config->interface[ctrlif].altsetting[0];
host_iface = &config->interface[ctrlif]->altsetting[0];
if (!(p1 = snd_usb_find_csint_desc(host_iface->extra, host_iface->extralen, NULL, HEADER))) {
snd_printk(KERN_ERR "cannot find HEADER\n");
return -EINVAL;
......@@ -2313,7 +2313,7 @@ static int snd_usb_create_streams(snd_usb_audio_t *chip, int ctrlif)
dev->devnum, ctrlif, j);
continue;
}
iface = &config->interface[j];
iface = config->interface[j];
if (usb_interface_claimed(iface)) {
snd_printdd(KERN_INFO "%d:%d:%d: skipping, already claimed\n", dev->devnum, ctrlif, j);
continue;
......@@ -2429,7 +2429,7 @@ static int create_composite_quirk(snd_usb_audio_t *chip,
for (quirk = quirk->data; quirk->ifnum >= 0; ++quirk) {
if (quirk->ifnum >= get_cfg_desc(config)->bNumInterfaces)
continue;
iface = &config->interface[quirk->ifnum];
iface = config->interface[quirk->ifnum];
if (quirk->ifnum != probed_ifnum &&
usb_interface_claimed(iface))
continue;
......
......@@ -1490,7 +1490,7 @@ int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif)
int err;
const struct usbmix_ctl_map *map;
struct usb_device_descriptor *dev = &chip->dev->descriptor;
struct usb_host_interface *hostif = &chip->dev->actconfig->interface[ctrlif].altsetting[0];
struct usb_host_interface *hostif = &chip->dev->actconfig->interface[ctrlif]->altsetting[0];
strcpy(chip->card->mixername, "USB Mixer");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment