]>
Commit | Line | Data |
---|---|---|
b5a39c4d JR |
1 | init_etherdev() allocates and registers the network device in one |
2 | step. it uses eth%d as the template for the device names. this | |
3 | conflicts with already registered ethernet devices, like eth0. since | |
4 | we want a fixed (and different name) this patch uses alloc_etherdev, | |
5 | rewrites the device name and then registers our interface. | |
6 | ||
7 | Index: linux/net/atm/lec.c | |
8 | =================================================================== | |
9 | RCS file: /home/chas/CVSROOT/linux/net/atm/lec.c,v | |
10 | retrieving revision 1.12 | |
11 | diff -u -r1.12 lec.c | |
12 | --- linux/net/atm/lec.c 3 Mar 2003 22:23:13 -0000 1.12 | |
13 | +++ linux/net/atm/lec.c 3 Mar 2003 22:29:02 -0000 | |
14 | @@ -784,15 +784,19 @@ | |
15 | size = sizeof(struct lec_priv); | |
16 | #ifdef CONFIG_TR | |
17 | if (is_trdev) | |
18 | - dev_lec[i] = init_trdev(NULL, size); | |
19 | + dev_lec[i] = alloc_trdev(size); | |
20 | else | |
21 | #endif | |
22 | - dev_lec[i] = init_etherdev(NULL, size); | |
23 | + dev_lec[i] = alloc_etherdev(size); | |
24 | if (!dev_lec[i]) | |
25 | return -ENOMEM; | |
26 | + snprintf(dev_lec[i]->name, IFNAMSIZ, "lec%d", i); | |
27 | + if (register_netdev(dev_lec[i])) { | |
28 | + kfree(dev_lec[i]); | |
29 | + return -EINVAL; | |
30 | + } | |
31 | priv = dev_lec[i]->priv; | |
32 | priv->is_trdev = is_trdev; | |
33 | - sprintf(dev_lec[i]->name, "lec%d", i); | |
34 | lec_init(dev_lec[i]); | |
35 | } else { | |
36 | priv = dev_lec[i]->priv; | |
37 | - | |
38 | To unsubscribe from this list: send the line "unsubscribe linux-kernel" in | |
39 | the body of a message to majordomo@vger.kernel.org | |
40 | More majordomo info at http://vger.kernel.org/majordomo-info.html | |
41 | Please read the FAQ at http://www.tux.org/lkml/ |