ChangeSet 1.1608.24.38, 2004/03/03 12:53:03-08:00, stern@rowland.harvard.edu [PATCH] USB: Convert usb-storage to use cur_altsetting I'm beginning the process of converting device drivers to use cur_altsetting with usb-storage, the one I know best. Only a few changes are needed (and the first one isn't even really necessary). drivers/usb/storage/usb.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c --- a/drivers/usb/storage/usb.c Tue Mar 16 15:04:27 2004 +++ b/drivers/usb/storage/usb.c Tue Mar 16 15:04:27 2004 @@ -423,7 +423,7 @@ /* Fill in the device-related fields */ us->pusb_dev = interface_to_usbdev(intf); us->pusb_intf = intf; - us->ifnum = intf->altsetting->desc.bInterfaceNumber; + us->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; /* Store our private data in the interface and increment the * device's reference count */ @@ -452,7 +452,7 @@ { struct usb_device *dev = us->pusb_dev; struct usb_interface_descriptor *idesc = - &us->pusb_intf->altsetting[us->pusb_intf->act_altsetting].desc; + &us->pusb_intf->cur_altsetting->desc; struct us_unusual_dev *unusual_dev = &us_unusual_dev_list[id_index]; struct usb_device_id *id = &storage_usb_ids[id_index]; @@ -686,7 +686,7 @@ static int get_pipes(struct us_data *us) { struct usb_host_interface *altsetting = - &us->pusb_intf->altsetting[us->pusb_intf->act_altsetting]; + us->pusb_intf->cur_altsetting; int i; struct usb_endpoint_descriptor *ep; struct usb_endpoint_descriptor *ep_in = NULL; @@ -877,8 +877,9 @@ int result; US_DEBUGP("USB Mass Storage device detected\n"); - US_DEBUGP("act_altsetting is %d, id_index is %d\n", - intf->act_altsetting, id_index); + US_DEBUGP("altsetting is %d, id_index is %d\n", + intf->cur_altsetting->desc.bAlternateSetting, + id_index); /* Allocate the us_data structure and initialize the mutexes */ us = (struct us_data *) kmalloc(sizeof(*us), GFP_KERNEL);