summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>2003-06-02 06:50:46 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-06-02 06:50:46 -0700
commit3c54d14f1fca817d4ab7d92bd804ec4bc3ca3cd7 (patch)
treeb405d31d67561057e0feec4ac8830f4afdf3c156
parent80e473714b7e7b8ed1aad8815e1721cee6baaf4c (diff)
[NET]: Eliminate init_fddidev.
-rw-r--r--drivers/net/defxx.c13
-rw-r--r--drivers/net/net_init.c23
-rw-r--r--include/linux/fddidevice.h1
3 files changed, 7 insertions, 30 deletions
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index 4cec39502f08..a80315d2cd2e 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -425,11 +425,7 @@ static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
}
#endif
- /*
- * init_fddidev() allocates a device structure with private data, clears the device structure and private data,
- * and calls fddi_setup() and register_netdev(). Not much left to do for us here.
- */
- dev = init_fddidev(NULL, sizeof(*bp));
+ dev = alloc_fddidev(sizeof(*bp));
if (!dev) {
printk (KERN_ERR "defxx: unable to allocate fddidev, aborting\n");
return -ENOMEM;
@@ -483,12 +479,17 @@ static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
goto err_out_region;
}
+ err = register_netdev(dev);
+ if (err)
+ goto err_out_kfree;
+
return 0;
+err_out_kfree:
+ if (bp->kmalloced) kfree(bp->kmalloced);
err_out_region:
release_region(ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN);
err_out:
- unregister_netdev(dev);
kfree(dev);
return err;
}
diff --git a/drivers/net/net_init.c b/drivers/net/net_init.c
index a6031828c9b6..4fe7c744a3c2 100644
--- a/drivers/net/net_init.c
+++ b/drivers/net/net_init.c
@@ -252,28 +252,6 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu)
#ifdef CONFIG_FDDI
/**
- * init_fddidev - Register FDDI device
- * @dev: A FDDI device structure to be filled in, or %NULL if a new
- * struct should be allocated.
- * @sizeof_priv: Size of additional driver-private structure to be allocated
- * for this ethernet device
- *
- * Fill in the fields of the device structure with FDDI-generic values.
- *
- * If no device structure is passed, a new one is constructed, complete with
- * a private data area of size @sizeof_priv. A 32-byte (not bit)
- * alignment is enforced for this private data area.
- *
- * If an empty string area is passed as dev->name, or a new structure is made,
- * a new name string is constructed.
- */
-
-struct net_device *init_fddidev(struct net_device *dev, int sizeof_priv)
-{
- return init_netdev(dev, sizeof_priv, "fddi%d", fddi_setup);
-}
-
-/**
* alloc_fddidev - Register FDDI device
* @sizeof_priv: Size of additional driver-private structure to be allocated
* for this FDDI device
@@ -290,7 +268,6 @@ struct net_device *alloc_fddidev(int sizeof_priv)
return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup);
}
-EXPORT_SYMBOL(init_fddidev);
EXPORT_SYMBOL(alloc_fddidev);
static int fddi_change_mtu(struct net_device *dev, int new_mtu)
diff --git a/include/linux/fddidevice.h b/include/linux/fddidevice.h
index 83815ec9faa0..b6c55dad37a4 100644
--- a/include/linux/fddidevice.h
+++ b/include/linux/fddidevice.h
@@ -34,7 +34,6 @@ extern int fddi_header(struct sk_buff *skb,
extern int fddi_rebuild_header(struct sk_buff *skb);
extern unsigned short fddi_type_trans(struct sk_buff *skb,
struct net_device *dev);
-extern struct net_device *init_fddidev(struct net_device *dev, int sizeof_priv);
extern struct net_device *alloc_fddidev(int sizeof_priv);
#endif