]> err.no Git - linux-2.6/blobdiff - drivers/usb/gadget/ether.c
usb: pxa27x_udc driver
[linux-2.6] / drivers / usb / gadget / ether.c
index 9e732bff9df0608670dcf88b5db1f6d2f5b95ce2..8d61ea67a8174a801d1ee0f8e902b2239ff53b70 100644 (file)
@@ -235,10 +235,6 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
 #define        DEV_CONFIG_CDC
 #endif
 
-#ifdef CONFIG_USB_GADGET_PXA27X
-#define DEV_CONFIG_CDC
-#endif
-
 #ifdef CONFIG_USB_GADGET_S3C2410
 #define DEV_CONFIG_CDC
 #endif
@@ -270,6 +266,10 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
 #define        DEV_CONFIG_SUBSET
 #endif
 
+#ifdef CONFIG_USB_GADGET_PXA27X
+#define        DEV_CONFIG_SUBSET
+#endif
+
 #ifdef CONFIG_USB_GADGET_SUPERH
 #define        DEV_CONFIG_SUBSET
 #endif
@@ -1067,19 +1067,19 @@ done:
 
        /* on error, disable any endpoints  */
        if (result < 0) {
-               if (!subset_active(dev))
+               if (!subset_active(dev) && dev->status_ep)
                        (void) usb_ep_disable (dev->status_ep);
                dev->status = NULL;
                (void) usb_ep_disable (dev->in_ep);
                (void) usb_ep_disable (dev->out_ep);
                dev->in = NULL;
                dev->out = NULL;
-       } else
+       }
 
        /* activate non-CDC configs right away
         * this isn't strictly according to the RNDIS spec
         */
-       if (!cdc_active (dev)) {
+       else if (!cdc_active (dev)) {
                netif_carrier_on (dev->net);
                if (netif_running (dev->net)) {
                        spin_unlock (&dev->lock);
@@ -1102,7 +1102,7 @@ static void eth_reset_config (struct eth_dev *dev)
        if (dev->config == 0)
                return;
 
-       DEBUG (dev, "%s\n", __FUNCTION__);
+       DEBUG (dev, "%s\n", __func__);
 
        netif_stop_queue (dev->net);
        netif_carrier_off (dev->net);
@@ -1263,7 +1263,7 @@ static void issue_start_status (struct eth_dev *dev)
        struct usb_cdc_notification     *event;
        int                             value;
 
-       DEBUG (dev, "%s, flush old status first\n", __FUNCTION__);
+       DEBUG (dev, "%s, flush old status first\n", __func__);
 
        /* flush old status
         *
@@ -1329,7 +1329,7 @@ static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req)
        spin_lock(&dev->lock);
        status = rndis_msg_parser (dev->rndis_config, (u8 *) req->buf);
        if (status < 0)
-               ERROR(dev, "%s: rndis parse error %d\n", __FUNCTION__, status);
+               ERROR(dev, "%s: rndis parse error %d\n", __func__, status);
        spin_unlock(&dev->lock);
 }
 
@@ -1561,6 +1561,7 @@ done_set_intf:
                                memcpy(req->buf, buf, n);
                                req->complete = rndis_response_complete;
                                rndis_free_response(dev->rndis_config, buf);
+                               value = n;
                        }
                        /* else stalls ... spec says to avoid that */
                }
@@ -2112,7 +2113,7 @@ static int rndis_control_ack (struct net_device *net)
 
 static void eth_start (struct eth_dev *dev, gfp_t gfp_flags)
 {
-       DEBUG (dev, "%s\n", __FUNCTION__);
+       DEBUG (dev, "%s\n", __func__);
 
        /* fill the rx queue */
        rx_fill (dev, gfp_flags);
@@ -2132,7 +2133,7 @@ static int eth_open (struct net_device *net)
 {
        struct eth_dev          *dev = netdev_priv(net);
 
-       DEBUG (dev, "%s\n", __FUNCTION__);
+       DEBUG (dev, "%s\n", __func__);
        if (netif_carrier_ok (dev->net))
                eth_start (dev, GFP_KERNEL);
        return 0;
@@ -2142,7 +2143,7 @@ static int eth_stop (struct net_device *net)
 {
        struct eth_dev          *dev = netdev_priv(net);
 
-       VDEBUG (dev, "%s\n", __FUNCTION__);
+       VDEBUG (dev, "%s\n", __func__);
        netif_stop_queue (net);
 
        DEBUG (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n",
@@ -2228,7 +2229,7 @@ eth_unbind (struct usb_gadget *gadget)
        set_gadget_data (gadget, NULL);
 }
 
-static u8 __devinit nibble (unsigned char c)
+static u8 __init nibble (unsigned char c)
 {
        if (likely (isdigit (c)))
                return c - '0';
@@ -2238,7 +2239,7 @@ static u8 __devinit nibble (unsigned char c)
        return 0;
 }
 
-static int __devinit get_ether_addr(const char *str, u8 *dev_addr)
+static int __init get_ether_addr(const char *str, u8 *dev_addr)
 {
        if (str) {
                unsigned        i;
@@ -2259,7 +2260,7 @@ static int __devinit get_ether_addr(const char *str, u8 *dev_addr)
        return 1;
 }
 
-static int __devinit
+static int __init
 eth_bind (struct usb_gadget *gadget)
 {
        struct eth_dev          *dev;