Commit aa5e7682 authored by Alexander Viro's avatar Alexander Viro Committed by David S. Miller

[NET]: Eliminate init_hippi_dev and {un,}register_hipdev.

parent 25e4e938
......@@ -330,29 +330,6 @@ static int hippi_mac_addr(struct net_device *dev, void *p)
return 0;
}
/**
* init_hippi_dev - Register HIPPI device
* @dev: A HIPPI 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 HIPPI-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_hippi_dev(struct net_device *dev, int sizeof_priv)
{
return init_netdev(dev, sizeof_priv, "hip%d", hippi_setup);
}
/**
* alloc_hippi_dev - Register HIPPI device
* @sizeof_priv: Size of additional driver-private structure to be allocated
......@@ -370,20 +347,7 @@ struct net_device *alloc_hippi_dev(int sizeof_priv)
return alloc_netdev(sizeof_priv, "hip%d", hippi_setup);
}
int register_hipdev(struct net_device *dev)
{
return __register_netdev(dev);
}
void unregister_hipdev(struct net_device *dev)
{
unregister_netdev(dev);
}
EXPORT_SYMBOL(init_hippi_dev);
EXPORT_SYMBOL(alloc_hippi_dev);
EXPORT_SYMBOL(register_hipdev);
EXPORT_SYMBOL(unregister_hipdev);
static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
{
......@@ -456,7 +420,7 @@ EXPORT_SYMBOL(fddi_setup);
#endif /* CONFIG_FDDI */
#ifdef CONFIG_HIPPI
void hippi_setup(struct net_device *dev)
static void hippi_setup(struct net_device *dev)
{
dev->set_multicast_list = NULL;
dev->change_mtu = hippi_change_mtu;
......@@ -487,7 +451,6 @@ void hippi_setup(struct net_device *dev)
*/
dev->flags = 0;
}
EXPORT_SYMBOL(hippi_setup);
#endif /* CONFIG_HIPPI */
#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE)
......
......@@ -97,13 +97,11 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
struct rr_private *rrpriv;
void *tmpptr;
dma_addr_t ring_dma;
int ret;
int ret = -ENOMEM;
dev = init_hippi_dev(NULL, sizeof(struct rr_private));
if (!dev) {
ret = -ENOMEM;
goto out2;
}
dev = alloc_hippi_dev(sizeof(struct rr_private));
if (!dev)
goto out3;
ret = pci_enable_device(pdev);
if (ret) {
......@@ -210,6 +208,10 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
rr_init(dev);
dev->base_addr = 0;
ret = register_netdev(dev);
if (ret)
goto out;
return 0;
out:
......@@ -225,12 +227,9 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
pci_release_regions(pdev);
pci_set_drvdata(pdev, NULL);
}
out2:
if (dev) {
unregister_hipdev(dev);
kfree(dev);
}
kfree(dev);
out3:
return ret;
}
......@@ -252,7 +251,7 @@ static void __devexit rr_remove_one (struct pci_dev *pdev)
rr->rx_ring_dma);
pci_free_consistent(pdev, TX_TOTAL_SIZE, rr->tx_ring,
rr->tx_ring_dma);
unregister_hipdev(dev);
unregister_netdev(dev);
iounmap(rr->regs);
kfree(dev);
pci_release_regions(pdev);
......
......@@ -49,12 +49,8 @@ extern void hippi_header_cache_update(struct hh_cache *hh,
extern int hippi_header_parse(struct sk_buff *skb, unsigned char *haddr);
extern void hippi_net_init(void);
void hippi_setup(struct net_device *dev);
extern struct net_device *init_hippi_dev(struct net_device *dev, int sizeof_priv);
extern struct net_device *alloc_hippi_dev(int sizeof_priv);
extern int register_hipdev(struct net_device *dev);
extern void unregister_hipdev(struct net_device *dev);
#endif
#endif /* _LINUX_HIPPIDEVICE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment