diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2006-06-22 22:20:19 +0200 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-06-22 23:32:03 -0400 |
commit | 4a31e348e3ecaf54c50240109ac4574b180f8840 (patch) | |
tree | 319978d90b95c7f1d4bf1fdfc552dc8850f330e7 | |
parent | aa95abefccc25efea5c8654bc3475e8161319b94 (diff) | |
download | linux-3.10-4a31e348e3ecaf54c50240109ac4574b180f8840.tar.gz linux-3.10-4a31e348e3ecaf54c50240109ac4574b180f8840.tar.bz2 linux-3.10-4a31e348e3ecaf54c50240109ac4574b180f8840.zip |
[PATCH] WAN: register_hdlc_device() doesn't need dev_alloc_name()
David Boggs noticed that register_hdlc_device() no longer needs
to call dev_alloc_name() as it's called by register_netdev().
register_hdlc_device() is currently equivalent to register_netdev().
hdlc_setup() is now EXPORTed as per David's request.
Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/wan/hdlc_generic.c | 24 | ||||
-rw-r--r-- | include/linux/hdlc.h | 2 |
2 files changed, 3 insertions, 23 deletions
diff --git a/drivers/net/wan/hdlc_generic.c b/drivers/net/wan/hdlc_generic.c index 46cef8f9213..57f9538b8fb 100644 --- a/drivers/net/wan/hdlc_generic.c +++ b/drivers/net/wan/hdlc_generic.c @@ -259,7 +259,7 @@ int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } } -static void hdlc_setup(struct net_device *dev) +void hdlc_setup(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); @@ -288,26 +288,6 @@ struct net_device *alloc_hdlcdev(void *priv) return dev; } -int register_hdlc_device(struct net_device *dev) -{ - int result = dev_alloc_name(dev, "hdlc%d"); - if (result < 0) - return result; - - result = register_netdev(dev); - if (result != 0) - return -EIO; - -#if 0 - if (netif_carrier_ok(dev)) - netif_carrier_off(dev); /* no carrier until DCD goes up */ -#endif - - return 0; -} - - - void unregister_hdlc_device(struct net_device *dev) { rtnl_lock(); @@ -326,8 +306,8 @@ EXPORT_SYMBOL(hdlc_open); EXPORT_SYMBOL(hdlc_close); EXPORT_SYMBOL(hdlc_set_carrier); EXPORT_SYMBOL(hdlc_ioctl); +EXPORT_SYMBOL(hdlc_setup); EXPORT_SYMBOL(alloc_hdlcdev); -EXPORT_SYMBOL(register_hdlc_device); EXPORT_SYMBOL(unregister_hdlc_device); static struct packet_type hdlc_packet_type = { diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index df695e9ae32..4513f9e4093 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h @@ -188,7 +188,7 @@ int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr); int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); /* Must be used by hardware driver on module startup/exit */ -int register_hdlc_device(struct net_device *dev); +#define register_hdlc_device(dev) register_netdev(dev) void unregister_hdlc_device(struct net_device *dev); struct net_device *alloc_hdlcdev(void *priv); |