Commit 8dbe0a71 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Altsetting/interface update for USB image drivers

This patch contains minute updates for the hpusbscsi, mdc800, and microtek
drivers.  Only two things are worth noting.  In the mdc800 driver I
removed some unnecessary calls to usb_driver_claim_interface(),
usb_driver_release_interface(), and usb_set_interface().  Likewise, in the
microtek driver I removed an unnecessary call to usb_set_interface().
parent bcffdf5c
......@@ -42,7 +42,7 @@ hpusbscsi_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct usb_device *dev = interface_to_usbdev(intf);
struct usb_host_interface *altsetting = intf->altsetting;
struct usb_host_interface *altsetting = intf->cur_altsetting;
struct hpusbscsi *new;
int error = -ENOMEM;
int i;
......
......@@ -431,7 +431,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
err ("probe fails -> wrong Number of Configuration");
return -ENODEV;
}
intf_desc = &intf->altsetting[0];
intf_desc = intf->cur_altsetting;
if (
( intf_desc->desc.bInterfaceClass != 0xff )
......@@ -469,13 +469,6 @@ static int mdc800_usb_probe (struct usb_interface *intf,
}
usb_driver_claim_interface (&mdc800_usb_driver, intf, mdc800);
if (usb_set_interface (dev, intf_desc->desc.bInterfaceNumber, 0) < 0)
{
err ("MDC800 Configuration fails.");
return -ENODEV;
}
info ("Found Mustek MDC800 on USB.");
down (&mdc800->io_lock);
......@@ -551,8 +544,6 @@ static void mdc800_usb_disconnect (struct usb_interface *intf)
usb_unlink_urb (mdc800->write_urb);
usb_unlink_urb (mdc800->download_urb);
usb_driver_release_interface (&mdc800_usb_driver, intf);
mdc800->dev=0;
usb_set_intfdata(intf, NULL);
}
......
......@@ -693,7 +693,6 @@ static int mts_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
int i;
int result;
int ep_out = -1;
int ep_in_set[3]; /* this will break if we have more than three endpoints
which is why we check */
......@@ -703,7 +702,7 @@ static int mts_usb_probe(struct usb_interface *intf,
struct vendor_product const* p;
struct usb_device *dev = interface_to_usbdev (intf);
/* the altsettting 0 on the interface we're probing */
/* the current altsetting on the interface we're probing */
struct usb_host_interface *altsetting;
MTS_DEBUG_GOT_HERE();
......@@ -724,8 +723,8 @@ static int mts_usb_probe(struct usb_interface *intf,
MTS_MESSAGE( "model %s is not known to be fully supported, reports welcome!\n",
p->name );
/* the altsettting 0 on the interface we're probing */
altsetting = &(intf->altsetting[0]);
/* the current altsetting on the interface we're probing */
altsetting = intf->cur_altsetting;
/* Check if the config is sane */
......@@ -766,20 +765,6 @@ static int mts_usb_probe(struct usb_interface *intf,
MTS_WARNING( "couldn't find an output bulk endpoint. Bailing out.\n" );
return -ENODEV;
}
result = usb_set_interface(dev, altsetting->desc.bInterfaceNumber, 0);
MTS_DEBUG("usb_set_interface returned %d.\n",result);
switch( result )
{
case 0: /* no error */
break;
default:
MTS_DEBUG( "unknown error %d from usb_set_interface\n",
(int)result );
return -ENODEV;
}
new_desc = kmalloc(sizeof(struct mts_desc), GFP_KERNEL);
......
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