]> git.pld-linux.org Git - packages/kernel.git/blame - atm-11-correct-lec-net_device-names.patch
- replaced by linux-2.4-sfq.patch
[packages/kernel.git] / atm-11-correct-lec-net_device-names.patch
CommitLineData
b5a39c4d
JR
1init_etherdev() allocates and registers the network device in one
2step. it uses eth%d as the template for the device names. this
3conflicts with already registered ethernet devices, like eth0. since
4we want a fixed (and different name) this patch uses alloc_etherdev,
5rewrites the device name and then registers our interface.
6
7Index: linux/net/atm/lec.c
8===================================================================
9RCS file: /home/chas/CVSROOT/linux/net/atm/lec.c,v
10retrieving revision 1.12
11diff -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-
38To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
39the body of a message to majordomo@vger.kernel.org
40More majordomo info at http://vger.kernel.org/majordomo-info.html
41Please read the FAQ at http://www.tux.org/lkml/
This page took 0.127493 seconds and 4 git commands to generate.