]> git.hungrycats.org Git - linux/commitdiff
[netdrvr] alloc_etherdev-related cleanups
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sat, 10 Jan 2004 10:34:08 +0000 (05:34 -0500)
committerStephen Hemminger <shemminger@osdl.org>
Sat, 10 Jan 2004 10:34:08 +0000 (05:34 -0500)
Mostly removing unneeded calls to ether_setup(), which alloc_etherdev()
already does for us.

drivers/net/ethertap.c
drivers/net/plip.c
drivers/usb/gadget/ether.c

index 7f4f4ae8c5c62ca00697861bb9c90c0ace78da46..6f2de5295cf4b3fa6da0aa5a159a0c15631d2602 100644 (file)
@@ -72,8 +72,7 @@ static int  __init ethertap_probe(int unit)
        struct net_device *dev;
        int err = -ENOMEM;
 
-       dev = alloc_netdev(sizeof(struct net_local), "tap%d",
-                          ether_setup);
+       dev = alloc_etherdev(sizeof(struct net_local));
 
        if (!dev)
                goto out;
index 8b8c640847d7bad1a21b5539c75e3f102a5a113b..83236666372cc6cb4170bed7362b51fe98dbad05 100644 (file)
@@ -1282,13 +1282,13 @@ static void plip_attach (struct parport *port)
                }
 
                sprintf(name, "plip%d", unit);
-               dev = alloc_netdev(sizeof(struct net_local), name, 
-                                  ether_setup);
+               dev = alloc_etherdev(sizeof(struct net_local));
                if (!dev) {
                        printk(KERN_ERR "plip: memory squeeze\n");
                        return;
                }
                
+               strcpy(dev->name, name);
                dev->init = plip_init_netdev;
 
                SET_MODULE_OWNER(dev);
index 131ee14bc56872214914a0b5f47384cfb47c7520..ad62e0f39dd7a0726dd4fe25403953fba761f271 100644 (file)
@@ -1782,9 +1782,7 @@ eth_bind (struct usb_gadget *gadget)
        /* network device setup */
        dev->net = net;
        SET_MODULE_OWNER (net);
-       net->priv = dev;
        strcpy (net->name, "usb%d");
-       ether_setup (net);
 
        /* one random address for the gadget device ... both of these could
         * reasonably come from an id prom or a module parameter.