]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/gadget/epautoconf.c
usb gadget: descriptor copying support
[linux-2.6-omap-h63xx.git] / drivers / usb / gadget / epautoconf.c
index 6042364402b8fb0b4fe1551fe8b5c57b8ae190c5..9462e30192d8d742d419b59821cb135d89176ae3 100644 (file)
 #include <linux/string.h>
 
 #include <linux/usb/ch9.h>
-#include <linux/usb_gadget.h>
+#include <linux/usb/gadget.h>
 
 #include "gadget_chips.h"
 
 
 /* we must assign addresses for configurable endpoints (like net2280) */
-static __devinitdata unsigned epnum;
+static __initdata unsigned epnum;
 
 // #define MANY_ENDPOINTS
 #ifdef MANY_ENDPOINTS
 /* more than 15 configurable endpoints */
-static __devinitdata unsigned in_epnum;
+static __initdata unsigned in_epnum;
 #endif
 
 
@@ -59,7 +59,7 @@ static __devinitdata unsigned in_epnum;
  * NOTE:  each endpoint is unidirectional, as specified by its USB
  * descriptor; and isn't specific to a configuration or altsetting.
  */
-static int __devinit
+static int __init
 ep_matches (
        struct usb_gadget               *gadget,
        struct usb_ep                   *ep,
@@ -71,7 +71,7 @@ ep_matches (
        u16             max;
 
        /* endpoint already claimed? */
-       if (0 != ep->driver_data)
+       if (NULL != ep->driver_data)
                return 0;
 
        /* only support ep0 for portable CONTROL traffic */
@@ -159,6 +159,7 @@ ep_matches (
        /* MATCH!! */
 
        /* report address */
+       desc->bEndpointAddress &= USB_DIR_IN;
        if (isdigit (ep->name [2])) {
                u8      num = simple_strtol (&ep->name [2], NULL, 10);
                desc->bEndpointAddress |= num;
@@ -186,7 +187,7 @@ ep_matches (
        return 1;
 }
 
-static struct usb_ep * __devinit
+static struct usb_ep * __init
 find_ep (struct usb_gadget *gadget, const char *name)
 {
        struct usb_ep   *ep;
@@ -228,7 +229,7 @@ find_ep (struct usb_gadget *gadget, const char *name)
  *
  * On failure, this returns a null endpoint descriptor.
  */
-struct usb_ep * __devinit usb_ep_autoconfig (
+struct usb_ep * __init usb_ep_autoconfig (
        struct usb_gadget               *gadget,
        struct usb_endpoint_descriptor  *desc
 )
@@ -295,7 +296,7 @@ struct usb_ep * __devinit usb_ep_autoconfig (
  * state such as ep->driver_data and the record of assigned endpoints
  * used by usb_ep_autoconfig().
  */
-void __devinit usb_ep_autoconfig_reset (struct usb_gadget *gadget)
+void __init usb_ep_autoconfig_reset (struct usb_gadget *gadget)
 {
        struct usb_ep   *ep;