ChangeSet 1.1608.84.31, 2004/03/10 13:44:37-08:00, [EMAIL PROTECTED]

[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().


 drivers/usb/image/hpusbscsi.c |    2 +-
 drivers/usb/image/mdc800.c    |   11 +----------
 drivers/usb/image/microtek.c  |   21 +++------------------
 3 files changed, 5 insertions(+), 29 deletions(-)


diff -Nru a/drivers/usb/image/hpusbscsi.c b/drivers/usb/image/hpusbscsi.c
--- a/drivers/usb/image/hpusbscsi.c     Tue Mar 16 15:01:46 2004
+++ b/drivers/usb/image/hpusbscsi.c     Tue Mar 16 15:01:46 2004
@@ -42,7 +42,7 @@
                    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;
diff -Nru a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c
--- a/drivers/usb/image/mdc800.c        Tue Mar 16 15:01:46 2004
+++ b/drivers/usb/image/mdc800.c        Tue Mar 16 15:01:46 2004
@@ -431,7 +431,7 @@
                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 @@
        }
 
 
-       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);
@@ -550,8 +543,6 @@
                usb_unlink_urb (mdc800->irq_urb);
                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);
diff -Nru a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
--- a/drivers/usb/image/microtek.c      Tue Mar 16 15:01:46 2004
+++ b/drivers/usb/image/microtek.c      Tue Mar 16 15:01:46 2004
@@ -693,7 +693,6 @@
                         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 @@
        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 @@
                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 */
@@ -765,20 +764,6 @@
        if ( ep_out == -1 ) {
                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;
        }
        
        



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to