diff options
Diffstat (limited to 'drivers/net/slip.c')
-rw-r--r-- | drivers/net/slip.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 6f97c5983c5..11c9ab3b1e1 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -723,6 +723,7 @@ static void sl_sync(void) static struct slip *sl_alloc(dev_t line) { int i; + char name[IFNAMSIZ]; struct net_device *dev = NULL; struct slip *sl; @@ -735,25 +736,12 @@ static struct slip *sl_alloc(dev_t line) if (i >= slip_maxdev) return NULL; - if (dev) { - sl = netdev_priv(dev); - if (test_bit(SLF_INUSE, &sl->flags)) { - unregister_netdevice(dev); - dev = NULL; - slip_devs[i] = NULL; - } - } - - if (!dev) { - char name[IFNAMSIZ]; - sprintf(name, "sl%d", i); - - dev = alloc_netdev(sizeof(*sl), name, sl_setup); - if (!dev) - return NULL; - dev->base_addr = i; - } + sprintf(name, "sl%d", i); + dev = alloc_netdev(sizeof(*sl), name, sl_setup); + if (!dev) + return NULL; + dev->base_addr = i; sl = netdev_priv(dev); /* Initialize channel control data */ |