diff options
author | Tom Gundersen <teg@jklm.no> | 2014-07-14 10:37:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-15 19:12:48 -0400 |
commit | c835a677331495cf137a7f8a023463afd9f032f8 (patch) | |
tree | ca1b7c3aa3c2404f7912388e70f7e0cb9cf37043 | |
parent | 238fa3623a5709d29673ed78ff8e714d040fbb89 (diff) |
net: set name_assign_type in alloc_netdev()
Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
all users to pass NET_NAME_UNKNOWN.
Coccinelle patch:
@@
expression sizeof_priv, name, setup, txqs, rxqs, count;
@@
(
-alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
+alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
|
-alloc_netdev_mq(sizeof_priv, name, setup, count)
+alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
|
-alloc_netdev(sizeof_priv, name, setup)
+alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
)
v9: move comments here from the wrong commit
Signed-off-by: Tom Gundersen <teg@jklm.no>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
97 files changed, 185 insertions, 133 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index c3986452194d..2c68da1ceeee 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
@@ -1460,7 +1460,8 @@ static int fwnet_probe(struct fw_unit *unit, | |||
1460 | goto have_dev; | 1460 | goto have_dev; |
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev); | 1463 | net = alloc_netdev(sizeof(*dev), "firewire%d", NET_NAME_UNKNOWN, |
1464 | fwnet_init_dev); | ||
1464 | if (net == NULL) { | 1465 | if (net == NULL) { |
1465 | mutex_unlock(&fwnet_device_mutex); | 1466 | mutex_unlock(&fwnet_device_mutex); |
1466 | return -ENOMEM; | 1467 | return -ENOMEM; |
diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c index ce4be3738d46..737fa2e0e782 100644 --- a/drivers/hsi/clients/ssi_protocol.c +++ b/drivers/hsi/clients/ssi_protocol.c | |||
@@ -1115,7 +1115,7 @@ static int ssi_protocol_probe(struct device *dev) | |||
1115 | goto out; | 1115 | goto out; |
1116 | } | 1116 | } |
1117 | 1117 | ||
1118 | ssi->netdev = alloc_netdev(0, ifname, ssip_pn_setup); | 1118 | ssi->netdev = alloc_netdev(0, ifname, NET_NAME_UNKNOWN, ssip_pn_setup); |
1119 | if (!ssi->netdev) { | 1119 | if (!ssi->netdev) { |
1120 | dev_err(dev, "No memory for netdev\n"); | 1120 | dev_err(dev, "No memory for netdev\n"); |
1121 | err = -ENOMEM; | 1121 | err = -ENOMEM; |
diff --git a/drivers/infiniband/hw/amso1100/c2_provider.c b/drivers/infiniband/hw/amso1100/c2_provider.c index 8af33cf1fc4e..2d5cbf4363e4 100644 --- a/drivers/infiniband/hw/amso1100/c2_provider.c +++ b/drivers/infiniband/hw/amso1100/c2_provider.c | |||
@@ -734,7 +734,7 @@ static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev) | |||
734 | /* change ethxxx to iwxxx */ | 734 | /* change ethxxx to iwxxx */ |
735 | strcpy(name, "iw"); | 735 | strcpy(name, "iw"); |
736 | strcat(name, &c2dev->netdev->name[3]); | 736 | strcat(name, &c2dev->netdev->name[3]); |
737 | netdev = alloc_netdev(0, name, setup); | 737 | netdev = alloc_netdev(0, name, NET_NAME_UNKNOWN, setup); |
738 | if (!netdev) { | 738 | if (!netdev) { |
739 | printk(KERN_ERR PFX "%s - etherdev alloc failed", | 739 | printk(KERN_ERR PFX "%s - etherdev alloc failed", |
740 | __func__); | 740 | __func__); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 5786a78ff8bc..4e675f4fecc9 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -1394,8 +1394,8 @@ struct ipoib_dev_priv *ipoib_intf_alloc(const char *name) | |||
1394 | { | 1394 | { |
1395 | struct net_device *dev; | 1395 | struct net_device *dev; |
1396 | 1396 | ||
1397 | dev = alloc_netdev((int) sizeof (struct ipoib_dev_priv), name, | 1397 | dev = alloc_netdev((int)sizeof(struct ipoib_dev_priv), name, |
1398 | ipoib_setup); | 1398 | NET_NAME_UNKNOWN, ipoib_setup); |
1399 | if (!dev) | 1399 | if (!dev) |
1400 | return NULL; | 1400 | return NULL; |
1401 | 1401 | ||
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index d9aebbc510cc..c2ed6246a389 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -2588,7 +2588,8 @@ isdn_net_new(char *name, struct net_device *master) | |||
2588 | printk(KERN_WARNING "isdn_net: Could not allocate net-device\n"); | 2588 | printk(KERN_WARNING "isdn_net: Could not allocate net-device\n"); |
2589 | return NULL; | 2589 | return NULL; |
2590 | } | 2590 | } |
2591 | netdev->dev = alloc_netdev(sizeof(isdn_net_local), name, _isdn_setup); | 2591 | netdev->dev = alloc_netdev(sizeof(isdn_net_local), name, |
2592 | NET_NAME_UNKNOWN, _isdn_setup); | ||
2592 | if (!netdev->dev) { | 2593 | if (!netdev->dev) { |
2593 | printk(KERN_WARNING "isdn_net: Could not allocate network device\n"); | 2594 | printk(KERN_WARNING "isdn_net: Could not allocate network device\n"); |
2594 | kfree(netdev); | 2595 | kfree(netdev); |
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c index 8a86b3025637..059e6117f22b 100644 --- a/drivers/media/dvb-core/dvb_net.c +++ b/drivers/media/dvb-core/dvb_net.c | |||
@@ -1276,7 +1276,8 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) | |||
1276 | if ((if_num = get_if(dvbnet)) < 0) | 1276 | if ((if_num = get_if(dvbnet)) < 0) |
1277 | return -EINVAL; | 1277 | return -EINVAL; |
1278 | 1278 | ||
1279 | net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", dvb_net_setup); | 1279 | net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", |
1280 | NET_NAME_UNKNOWN, dvb_net_setup); | ||
1280 | if (!net) | 1281 | if (!net) |
1281 | return -ENOMEM; | 1282 | return -ENOMEM; |
1282 | 1283 | ||
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index 3fac67a5204c..557f9782c53c 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c | |||
@@ -544,7 +544,8 @@ xpnet_init(void) | |||
544 | * use ether_setup() to init the majority of our device | 544 | * use ether_setup() to init the majority of our device |
545 | * structure and then override the necessary pieces. | 545 | * structure and then override the necessary pieces. |
546 | */ | 546 | */ |
547 | xpnet_device = alloc_netdev(0, XPNET_DEVICE_NAME, ether_setup); | 547 | xpnet_device = alloc_netdev(0, XPNET_DEVICE_NAME, NET_NAME_UNKNOWN, |
548 | ether_setup); | ||
548 | if (xpnet_device == NULL) { | 549 | if (xpnet_device == NULL) { |
549 | kfree(xpnet_broadcast_partitions); | 550 | kfree(xpnet_broadcast_partitions); |
550 | return -ENOMEM; | 551 | return -ENOMEM; |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index a956053608f9..3b790de6c976 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -346,7 +346,8 @@ struct net_device *alloc_arcdev(const char *name) | |||
346 | struct net_device *dev; | 346 | struct net_device *dev; |
347 | 347 | ||
348 | dev = alloc_netdev(sizeof(struct arcnet_local), | 348 | dev = alloc_netdev(sizeof(struct arcnet_local), |
349 | name && *name ? name : "arc%d", arcdev_setup); | 349 | name && *name ? name : "arc%d", NET_NAME_UNKNOWN, |
350 | arcdev_setup); | ||
350 | if(dev) { | 351 | if(dev) { |
351 | struct arcnet_local *lp = netdev_priv(dev); | 352 | struct arcnet_local *lp = netdev_priv(dev); |
352 | spin_lock_init(&lp->lock); | 353 | spin_lock_init(&lp->lock); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 09dc3ef771a7..46dcb7b6216f 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4420,7 +4420,7 @@ int bond_create(struct net *net, const char *name) | |||
4420 | rtnl_lock(); | 4420 | rtnl_lock(); |
4421 | 4421 | ||
4422 | bond_dev = alloc_netdev_mq(sizeof(struct bonding), | 4422 | bond_dev = alloc_netdev_mq(sizeof(struct bonding), |
4423 | name ? name : "bond%d", | 4423 | name ? name : "bond%d", NET_NAME_UNKNOWN, |
4424 | bond_setup, tx_queues); | 4424 | bond_setup, tx_queues); |
4425 | if (!bond_dev) { | 4425 | if (!bond_dev) { |
4426 | pr_err("%s: eek! can't alloc netdev!\n", name); | 4426 | pr_err("%s: eek! can't alloc netdev!\n", name); |
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index fc73865bb83a..27bbc56de15f 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c | |||
@@ -349,7 +349,8 @@ static int ldisc_open(struct tty_struct *tty) | |||
349 | result = snprintf(name, sizeof(name), "cf%s", tty->name); | 349 | result = snprintf(name, sizeof(name), "cf%s", tty->name); |
350 | if (result >= IFNAMSIZ) | 350 | if (result >= IFNAMSIZ) |
351 | return -EINVAL; | 351 | return -EINVAL; |
352 | dev = alloc_netdev(sizeof(*ser), name, caifdev_setup); | 352 | dev = alloc_netdev(sizeof(*ser), name, NET_NAME_UNKNOWN, |
353 | caifdev_setup); | ||
353 | if (!dev) | 354 | if (!dev) |
354 | return -ENOMEM; | 355 | return -ENOMEM; |
355 | 356 | ||
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c index ff54c0eb2052..72ea9ff9bb9c 100644 --- a/drivers/net/caif/caif_spi.c +++ b/drivers/net/caif/caif_spi.c | |||
@@ -730,8 +730,8 @@ int cfspi_spi_probe(struct platform_device *pdev) | |||
730 | int res; | 730 | int res; |
731 | dev = (struct cfspi_dev *)pdev->dev.platform_data; | 731 | dev = (struct cfspi_dev *)pdev->dev.platform_data; |
732 | 732 | ||
733 | ndev = alloc_netdev(sizeof(struct cfspi), | 733 | ndev = alloc_netdev(sizeof(struct cfspi), "cfspi%d", |
734 | "cfspi%d", cfspi_setup); | 734 | NET_NAME_UNKNOWN, cfspi_setup); |
735 | if (!dev) | 735 | if (!dev) |
736 | return -ENODEV; | 736 | return -ENODEV; |
737 | 737 | ||
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index 985608634f8c..a5fefb9059c5 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c | |||
@@ -661,7 +661,7 @@ static int cfv_probe(struct virtio_device *vdev) | |||
661 | int err = -EINVAL; | 661 | int err = -EINVAL; |
662 | 662 | ||
663 | netdev = alloc_netdev(sizeof(struct cfv_info), cfv_netdev_name, | 663 | netdev = alloc_netdev(sizeof(struct cfv_info), cfv_netdev_name, |
664 | cfv_netdev_setup); | 664 | NET_NAME_UNKNOWN, cfv_netdev_setup); |
665 | if (!netdev) | 665 | if (!netdev) |
666 | return -ENOMEM; | 666 | return -ENOMEM; |
667 | 667 | ||
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index e318e87e2bfc..9f91fcba43f8 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -565,7 +565,7 @@ struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max) | |||
565 | else | 565 | else |
566 | size = sizeof_priv; | 566 | size = sizeof_priv; |
567 | 567 | ||
568 | dev = alloc_netdev(size, "can%d", can_setup); | 568 | dev = alloc_netdev(size, "can%d", NET_NAME_UNKNOWN, can_setup); |
569 | if (!dev) | 569 | if (!dev) |
570 | return NULL; | 570 | return NULL; |
571 | 571 | ||
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c index ea4d4f1a6411..acb5b92ace92 100644 --- a/drivers/net/can/slcan.c +++ b/drivers/net/can/slcan.c | |||
@@ -529,7 +529,7 @@ static struct slcan *slc_alloc(dev_t line) | |||
529 | return NULL; | 529 | return NULL; |
530 | 530 | ||
531 | sprintf(name, "slcan%d", i); | 531 | sprintf(name, "slcan%d", i); |
532 | dev = alloc_netdev(sizeof(*sl), name, slc_setup); | 532 | dev = alloc_netdev(sizeof(*sl), name, NET_NAME_UNKNOWN, slc_setup); |
533 | if (!dev) | 533 | if (!dev) |
534 | return NULL; | 534 | return NULL; |
535 | 535 | ||
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index 0932ffbf381b..ff435fbd1ad0 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -164,7 +164,7 @@ static int __init dummy_init_one(void) | |||
164 | struct net_device *dev_dummy; | 164 | struct net_device *dev_dummy; |
165 | int err; | 165 | int err; |
166 | 166 | ||
167 | dev_dummy = alloc_netdev(0, "dummy%d", dummy_setup); | 167 | dev_dummy = alloc_netdev(0, "dummy%d", NET_NAME_UNKNOWN, dummy_setup); |
168 | if (!dev_dummy) | 168 | if (!dev_dummy) |
169 | return -ENOMEM; | 169 | return -ENOMEM; |
170 | 170 | ||
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index 7a79b6046879..957e5c0cede3 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
@@ -585,7 +585,8 @@ static int __init eql_init_module(void) | |||
585 | 585 | ||
586 | pr_info("%s\n", version); | 586 | pr_info("%s\n", version); |
587 | 587 | ||
588 | dev_eql = alloc_netdev(sizeof(equalizer_t), "eql", eql_setup); | 588 | dev_eql = alloc_netdev(sizeof(equalizer_t), "eql", NET_NAME_UNKNOWN, |
589 | eql_setup); | ||
589 | if (!dev_eql) | 590 | if (!dev_eql) |
590 | return -ENOMEM; | 591 | return -ENOMEM; |
591 | 592 | ||
diff --git a/drivers/net/ethernet/8390/lib8390.c b/drivers/net/ethernet/8390/lib8390.c index 599311f0e05c..b96e8852b2d1 100644 --- a/drivers/net/ethernet/8390/lib8390.c +++ b/drivers/net/ethernet/8390/lib8390.c | |||
@@ -986,7 +986,7 @@ static void ethdev_setup(struct net_device *dev) | |||
986 | static struct net_device *____alloc_ei_netdev(int size) | 986 | static struct net_device *____alloc_ei_netdev(int size) |
987 | { | 987 | { |
988 | return alloc_netdev(sizeof(struct ei_device) + size, "eth%d", | 988 | return alloc_netdev(sizeof(struct ei_device) + size, "eth%d", |
989 | ethdev_setup); | 989 | NET_NAME_UNKNOWN, ethdev_setup); |
990 | } | 990 | } |
991 | 991 | ||
992 | 992 | ||
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c index 4c70360967c2..69557a26f749 100644 --- a/drivers/net/ethernet/tile/tilegx.c +++ b/drivers/net/ethernet/tile/tilegx.c | |||
@@ -2201,8 +2201,8 @@ static void tile_net_dev_init(const char *name, const uint8_t *mac) | |||
2201 | /* Allocate the device structure. Normally, "name" is a | 2201 | /* Allocate the device structure. Normally, "name" is a |
2202 | * template, instantiated by register_netdev(), but not for us. | 2202 | * template, instantiated by register_netdev(), but not for us. |
2203 | */ | 2203 | */ |
2204 | dev = alloc_netdev_mqs(sizeof(*priv), name, tile_net_setup, | 2204 | dev = alloc_netdev_mqs(sizeof(*priv), name, NET_NAME_UNKNOWN, |
2205 | NR_CPUS, 1); | 2205 | tile_net_setup, NR_CPUS, 1); |
2206 | if (!dev) { | 2206 | if (!dev) { |
2207 | pr_err("alloc_netdev_mqs(%s) failed\n", name); | 2207 | pr_err("alloc_netdev_mqs(%s) failed\n", name); |
2208 | return; | 2208 | return; |
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c index e5a5c5d4ce0c..88c712126692 100644 --- a/drivers/net/ethernet/tile/tilepro.c +++ b/drivers/net/ethernet/tile/tilepro.c | |||
@@ -2292,7 +2292,8 @@ static struct net_device *tile_net_dev_init(const char *name) | |||
2292 | * tile_net_setup(), and saves "name". Normally, "name" is a | 2292 | * tile_net_setup(), and saves "name". Normally, "name" is a |
2293 | * template, instantiated by register_netdev(), but not for us. | 2293 | * template, instantiated by register_netdev(), but not for us. |
2294 | */ | 2294 | */ |
2295 | dev = alloc_netdev(sizeof(*priv), name, tile_net_setup); | 2295 | dev = alloc_netdev(sizeof(*priv), name, NET_NAME_UNKNOWN, |
2296 | tile_net_setup); | ||
2296 | if (!dev) { | 2297 | if (!dev) { |
2297 | pr_err("alloc_netdev(%s) failed\n", name); | 2298 | pr_err("alloc_netdev(%s) failed\n", name); |
2298 | return NULL; | 2299 | return NULL; |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 66e2b19ef709..c3c4051a089d 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -596,7 +596,8 @@ static int sixpack_open(struct tty_struct *tty) | |||
596 | if (tty->ops->write == NULL) | 596 | if (tty->ops->write == NULL) |
597 | return -EOPNOTSUPP; | 597 | return -EOPNOTSUPP; |
598 | 598 | ||
599 | dev = alloc_netdev(sizeof(struct sixpack), "sp%d", sp_setup); | 599 | dev = alloc_netdev(sizeof(struct sixpack), "sp%d", NET_NAME_UNKNOWN, |
600 | sp_setup); | ||
600 | if (!dev) { | 601 | if (!dev) { |
601 | err = -ENOMEM; | 602 | err = -ENOMEM; |
602 | goto out; | 603 | goto out; |
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 484f77ec2ce1..a98c153f371e 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -1206,7 +1206,7 @@ static int __init init_baycomepp(void) | |||
1206 | struct net_device *dev; | 1206 | struct net_device *dev; |
1207 | 1207 | ||
1208 | dev = alloc_netdev(sizeof(struct baycom_state), "bce%d", | 1208 | dev = alloc_netdev(sizeof(struct baycom_state), "bce%d", |
1209 | baycom_epp_dev_setup); | 1209 | NET_NAME_UNKNOWN, baycom_epp_dev_setup); |
1210 | 1210 | ||
1211 | if (!dev) { | 1211 | if (!dev) { |
1212 | printk(KERN_WARNING "bce%d : out of memory\n", i); | 1212 | printk(KERN_WARNING "bce%d : out of memory\n", i); |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index d50b23cf9ea9..c2894e43840e 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -501,8 +501,8 @@ static int bpq_new_device(struct net_device *edev) | |||
501 | struct net_device *ndev; | 501 | struct net_device *ndev; |
502 | struct bpqdev *bpq; | 502 | struct bpqdev *bpq; |
503 | 503 | ||
504 | ndev = alloc_netdev(sizeof(struct bpqdev), "bpq%d", | 504 | ndev = alloc_netdev(sizeof(struct bpqdev), "bpq%d", NET_NAME_UNKNOWN, |
505 | bpq_setup); | 505 | bpq_setup); |
506 | if (!ndev) | 506 | if (!ndev) |
507 | return -ENOMEM; | 507 | return -ENOMEM; |
508 | 508 | ||
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 6636022a1027..0fad408f24aa 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -466,7 +466,7 @@ static int __init setup_adapter(int card_base, int type, int n) | |||
466 | if (!info) | 466 | if (!info) |
467 | goto out; | 467 | goto out; |
468 | 468 | ||
469 | info->dev[0] = alloc_netdev(0, "", dev_setup); | 469 | info->dev[0] = alloc_netdev(0, "", NET_NAME_UNKNOWN, dev_setup); |
470 | if (!info->dev[0]) { | 470 | if (!info->dev[0]) { |
471 | printk(KERN_ERR "dmascc: " | 471 | printk(KERN_ERR "dmascc: " |
472 | "could not allocate memory for %s at %#3x\n", | 472 | "could not allocate memory for %s at %#3x\n", |
@@ -474,7 +474,7 @@ static int __init setup_adapter(int card_base, int type, int n) | |||
474 | goto out1; | 474 | goto out1; |
475 | } | 475 | } |
476 | 476 | ||
477 | info->dev[1] = alloc_netdev(0, "", dev_setup); | 477 | info->dev[1] = alloc_netdev(0, "", NET_NAME_UNKNOWN, dev_setup); |
478 | if (!info->dev[1]) { | 478 | if (!info->dev[1]) { |
479 | printk(KERN_ERR "dmascc: " | 479 | printk(KERN_ERR "dmascc: " |
480 | "could not allocate memory for %s at %#3x\n", | 480 | "could not allocate memory for %s at %#3x\n", |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index 5d78c1d08abd..c67a27245072 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -699,7 +699,7 @@ struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops, | |||
699 | if (privsize < sizeof(struct hdlcdrv_state)) | 699 | if (privsize < sizeof(struct hdlcdrv_state)) |
700 | privsize = sizeof(struct hdlcdrv_state); | 700 | privsize = sizeof(struct hdlcdrv_state); |
701 | 701 | ||
702 | dev = alloc_netdev(privsize, ifname, hdlcdrv_setup); | 702 | dev = alloc_netdev(privsize, ifname, NET_NAME_UNKNOWN, hdlcdrv_setup); |
703 | if (!dev) | 703 | if (!dev) |
704 | return ERR_PTR(-ENOMEM); | 704 | return ERR_PTR(-ENOMEM); |
705 | 705 | ||
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 8a6c720a4cc9..f990bb1c3e02 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -734,7 +734,8 @@ static int mkiss_open(struct tty_struct *tty) | |||
734 | if (tty->ops->write == NULL) | 734 | if (tty->ops->write == NULL) |
735 | return -EOPNOTSUPP; | 735 | return -EOPNOTSUPP; |
736 | 736 | ||
737 | dev = alloc_netdev(sizeof(struct mkiss), "ax%d", ax_setup); | 737 | dev = alloc_netdev(sizeof(struct mkiss), "ax%d", NET_NAME_UNKNOWN, |
738 | ax_setup); | ||
738 | if (!dev) { | 739 | if (!dev) { |
739 | err = -ENOMEM; | 740 | err = -ENOMEM; |
740 | goto out; | 741 | goto out; |
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index 4bc6ee8e7987..57be9e0e98a6 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c | |||
@@ -1515,7 +1515,7 @@ static int scc_net_alloc(const char *name, struct scc_channel *scc) | |||
1515 | int err; | 1515 | int err; |
1516 | struct net_device *dev; | 1516 | struct net_device *dev; |
1517 | 1517 | ||
1518 | dev = alloc_netdev(0, name, scc_net_setup); | 1518 | dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, scc_net_setup); |
1519 | if (!dev) | 1519 | if (!dev) |
1520 | return -ENOMEM; | 1520 | return -ENOMEM; |
1521 | 1521 | ||
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 81901659cc9e..717433cfb81d 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -1147,7 +1147,7 @@ static int __init yam_init_driver(void) | |||
1147 | sprintf(name, "yam%d", i); | 1147 | sprintf(name, "yam%d", i); |
1148 | 1148 | ||
1149 | dev = alloc_netdev(sizeof(struct yam_port), name, | 1149 | dev = alloc_netdev(sizeof(struct yam_port), name, |
1150 | yam_setup); | 1150 | NET_NAME_UNKNOWN, yam_setup); |
1151 | if (!dev) { | 1151 | if (!dev) { |
1152 | pr_err("yam: cannot allocate net device\n"); | 1152 | pr_err("yam: cannot allocate net device\n"); |
1153 | err = -ENOMEM; | 1153 | err = -ENOMEM; |
diff --git a/drivers/net/ieee802154/fakehard.c b/drivers/net/ieee802154/fakehard.c index 78f18be3bbf2..9ce854f43917 100644 --- a/drivers/net/ieee802154/fakehard.c +++ b/drivers/net/ieee802154/fakehard.c | |||
@@ -343,7 +343,8 @@ static int ieee802154fake_probe(struct platform_device *pdev) | |||
343 | if (!phy) | 343 | if (!phy) |
344 | return -ENOMEM; | 344 | return -ENOMEM; |
345 | 345 | ||
346 | dev = alloc_netdev(sizeof(struct fakehard_priv), "hardwpan%d", ieee802154_fake_setup); | 346 | dev = alloc_netdev(sizeof(struct fakehard_priv), "hardwpan%d", |
347 | NET_NAME_UNKNOWN, ieee802154_fake_setup); | ||
347 | if (!dev) { | 348 | if (!dev) { |
348 | wpan_phy_free(phy); | 349 | wpan_phy_free(phy); |
349 | return -ENOMEM; | 350 | return -ENOMEM; |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 46a7790be004..d2d4a3d2237f 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -269,8 +269,8 @@ static int __init ifb_init_one(int index) | |||
269 | struct ifb_private *dp; | 269 | struct ifb_private *dp; |
270 | int err; | 270 | int err; |
271 | 271 | ||
272 | dev_ifb = alloc_netdev(sizeof(struct ifb_private), | 272 | dev_ifb = alloc_netdev(sizeof(struct ifb_private), "ifb%d", |
273 | "ifb%d", ifb_setup); | 273 | NET_NAME_UNKNOWN, ifb_setup); |
274 | 274 | ||
275 | if (!dev_ifb) | 275 | if (!dev_ifb) |
276 | return -ENOMEM; | 276 | return -ENOMEM; |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index bb96409f8c05..8f2262540561 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -195,7 +195,7 @@ static __net_init int loopback_net_init(struct net *net) | |||
195 | int err; | 195 | int err; |
196 | 196 | ||
197 | err = -ENOMEM; | 197 | err = -ENOMEM; |
198 | dev = alloc_netdev(0, "lo", loopback_setup); | 198 | dev = alloc_netdev(0, "lo", NET_NAME_UNKNOWN, loopback_setup); |
199 | if (!dev) | 199 | if (!dev) |
200 | goto out; | 200 | goto out; |
201 | 201 | ||
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 91d6c1272fcf..5c002b1ef169 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
@@ -2665,7 +2665,8 @@ ppp_create_interface(struct net *net, int unit, int *retp) | |||
2665 | int ret = -ENOMEM; | 2665 | int ret = -ENOMEM; |
2666 | int i; | 2666 | int i; |
2667 | 2667 | ||
2668 | dev = alloc_netdev(sizeof(struct ppp), "", ppp_setup); | 2668 | dev = alloc_netdev(sizeof(struct ppp), "", NET_NAME_UNKNOWN, |
2669 | ppp_setup); | ||
2669 | if (!dev) | 2670 | if (!dev) |
2670 | goto out1; | 2671 | goto out1; |
2671 | 2672 | ||
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c index 87526443841f..05387b1e2e95 100644 --- a/drivers/net/slip/slip.c +++ b/drivers/net/slip/slip.c | |||
@@ -749,7 +749,7 @@ static struct slip *sl_alloc(dev_t line) | |||
749 | return NULL; | 749 | return NULL; |
750 | 750 | ||
751 | sprintf(name, "sl%d", i); | 751 | sprintf(name, "sl%d", i); |
752 | dev = alloc_netdev(sizeof(*sl), name, sl_setup); | 752 | dev = alloc_netdev(sizeof(*sl), name, NET_NAME_UNKNOWN, sl_setup); |
753 | if (!dev) | 753 | if (!dev) |
754 | return NULL; | 754 | return NULL; |
755 | 755 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 98bad1fb1bfb..acaaf6784179 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1633,7 +1633,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
1633 | name = ifr->ifr_name; | 1633 | name = ifr->ifr_name; |
1634 | 1634 | ||
1635 | dev = alloc_netdev_mqs(sizeof(struct tun_struct), name, | 1635 | dev = alloc_netdev_mqs(sizeof(struct tun_struct), name, |
1636 | tun_setup, queues, queues); | 1636 | NET_NAME_UNKNOWN, tun_setup, queues, |
1637 | queues); | ||
1637 | 1638 | ||
1638 | if (!dev) | 1639 | if (!dev) |
1639 | return -ENOMEM; | 1640 | return -ENOMEM; |
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 6358d420e185..2ec1500d0077 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c | |||
@@ -387,7 +387,7 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
387 | return -EINVAL; | 387 | return -EINVAL; |
388 | 388 | ||
389 | dev = alloc_netdev(sizeof(*pnd) + sizeof(pnd->urbs[0]) * rxq_size, | 389 | dev = alloc_netdev(sizeof(*pnd) + sizeof(pnd->urbs[0]) * rxq_size, |
390 | ifname, usbpn_setup); | 390 | ifname, NET_NAME_UNKNOWN, usbpn_setup); |
391 | if (!dev) | 391 | if (!dev) |
392 | return -ENOMEM; | 392 | return -ENOMEM; |
393 | 393 | ||
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index a3a05869309d..50b36b299946 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -2520,7 +2520,8 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface, | |||
2520 | 2520 | ||
2521 | /* allocate our network device, then we can put in our private data */ | 2521 | /* allocate our network device, then we can put in our private data */ |
2522 | /* call hso_net_init to do the basic initialization */ | 2522 | /* call hso_net_init to do the basic initialization */ |
2523 | net = alloc_netdev(sizeof(struct hso_net), "hso%d", hso_net_init); | 2523 | net = alloc_netdev(sizeof(struct hso_net), "hso%d", NET_NAME_UNKNOWN, |
2524 | hso_net_init); | ||
2524 | if (!net) { | 2525 | if (!net) { |
2525 | dev_err(&interface->dev, "Unable to create ethernet device\n"); | 2526 | dev_err(&interface->dev, "Unable to create ethernet device\n"); |
2526 | goto exit; | 2527 | goto exit; |
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index 19f7cb2cdef3..a463613a0719 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c | |||
@@ -327,8 +327,8 @@ static int dlci_add(struct dlci_add *dlci) | |||
327 | goto err1; | 327 | goto err1; |
328 | 328 | ||
329 | /* create device name */ | 329 | /* create device name */ |
330 | master = alloc_netdev( sizeof(struct dlci_local), "dlci%d", | 330 | master = alloc_netdev(sizeof(struct dlci_local), "dlci%d", |
331 | dlci_setup); | 331 | NET_NAME_UNKNOWN, dlci_setup); |
332 | if (!master) { | 332 | if (!master) { |
333 | err = -ENOMEM; | 333 | err = -ENOMEM; |
334 | goto err1; | 334 | goto err1; |
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index 9c33ca918e19..51f6cee8aab2 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c | |||
@@ -256,7 +256,8 @@ static void hdlc_setup(struct net_device *dev) | |||
256 | struct net_device *alloc_hdlcdev(void *priv) | 256 | struct net_device *alloc_hdlcdev(void *priv) |
257 | { | 257 | { |
258 | struct net_device *dev; | 258 | struct net_device *dev; |
259 | dev = alloc_netdev(sizeof(struct hdlc_device), "hdlc%d", hdlc_setup); | 259 | dev = alloc_netdev(sizeof(struct hdlc_device), "hdlc%d", |
260 | NET_NAME_UNKNOWN, hdlc_setup); | ||
260 | if (dev) | 261 | if (dev) |
261 | dev_to_hdlc(dev)->priv = priv; | 262 | dev_to_hdlc(dev)->priv = priv; |
262 | return dev; | 263 | return dev; |
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 7c6cb4f31798..7cc64eac0fa3 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -1075,10 +1075,11 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) | |||
1075 | used = pvc_is_used(pvc); | 1075 | used = pvc_is_used(pvc); |
1076 | 1076 | ||
1077 | if (type == ARPHRD_ETHER) { | 1077 | if (type == ARPHRD_ETHER) { |
1078 | dev = alloc_netdev(0, "pvceth%d", ether_setup); | 1078 | dev = alloc_netdev(0, "pvceth%d", NET_NAME_UNKNOWN, |
1079 | ether_setup); | ||
1079 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; | 1080 | dev->priv_flags &= ~IFF_TX_SKB_SHARING; |
1080 | } else | 1081 | } else |
1081 | dev = alloc_netdev(0, "pvc%d", pvc_setup); | 1082 | dev = alloc_netdev(0, "pvc%d", NET_NAME_UNKNOWN, pvc_setup); |
1082 | 1083 | ||
1083 | if (!dev) { | 1084 | if (!dev) { |
1084 | netdev_warn(frad, "Memory squeeze on fr_pvc()\n"); | 1085 | netdev_warn(frad, "Memory squeeze on fr_pvc()\n"); |
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index a33a46fa88dd..2f5eda8a7227 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -325,8 +325,8 @@ static int lapbeth_new_device(struct net_device *dev) | |||
325 | 325 | ||
326 | ASSERT_RTNL(); | 326 | ASSERT_RTNL(); |
327 | 327 | ||
328 | ndev = alloc_netdev(sizeof(*lapbeth), "lapb%d", | 328 | ndev = alloc_netdev(sizeof(*lapbeth), "lapb%d", NET_NAME_UNKNOWN, |
329 | lapbeth_setup); | 329 | lapbeth_setup); |
330 | if (!ndev) | 330 | if (!ndev) |
331 | goto out; | 331 | goto out; |
332 | 332 | ||
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 1b89ecf0959e..758c4ba1e97c 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -227,7 +227,8 @@ int __init sbni_probe(int unit) | |||
227 | struct net_device *dev; | 227 | struct net_device *dev; |
228 | int err; | 228 | int err; |
229 | 229 | ||
230 | dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup); | 230 | dev = alloc_netdev(sizeof(struct net_local), "sbni", |
231 | NET_NAME_UNKNOWN, sbni_devsetup); | ||
231 | if (!dev) | 232 | if (!dev) |
232 | return -ENOMEM; | 233 | return -ENOMEM; |
233 | 234 | ||
@@ -1477,8 +1478,8 @@ int __init init_module( void ) | |||
1477 | int err; | 1478 | int err; |
1478 | 1479 | ||
1479 | while( num < SBNI_MAX_NUM_CARDS ) { | 1480 | while( num < SBNI_MAX_NUM_CARDS ) { |
1480 | dev = alloc_netdev(sizeof(struct net_local), | 1481 | dev = alloc_netdev(sizeof(struct net_local), "sbni%d", |
1481 | "sbni%d", sbni_devsetup); | 1482 | NET_NAME_UNKNOWN, sbni_devsetup); |
1482 | if( !dev) | 1483 | if( !dev) |
1483 | break; | 1484 | break; |
1484 | 1485 | ||
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index cdd45fb8a1f6..421ac5f85699 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c | |||
@@ -1631,7 +1631,8 @@ static int __init init_sdla(void) | |||
1631 | 1631 | ||
1632 | printk("%s.\n", version); | 1632 | printk("%s.\n", version); |
1633 | 1633 | ||
1634 | sdla = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla); | 1634 | sdla = alloc_netdev(sizeof(struct frad_local), "sdla0", |
1635 | NET_NAME_UNKNOWN, setup_sdla); | ||
1635 | if (!sdla) | 1636 | if (!sdla) |
1636 | return -ENOMEM; | 1637 | return -ENOMEM; |
1637 | 1638 | ||
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 5895f1978691..df6c07357556 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -81,8 +81,8 @@ static struct x25_asy *x25_asy_alloc(void) | |||
81 | char name[IFNAMSIZ]; | 81 | char name[IFNAMSIZ]; |
82 | sprintf(name, "x25asy%d", i); | 82 | sprintf(name, "x25asy%d", i); |
83 | 83 | ||
84 | dev = alloc_netdev(sizeof(struct x25_asy), | 84 | dev = alloc_netdev(sizeof(struct x25_asy), name, |
85 | name, x25_asy_setup); | 85 | NET_NAME_UNKNOWN, x25_asy_setup); |
86 | if (!dev) | 86 | if (!dev) |
87 | return NULL; | 87 | return NULL; |
88 | 88 | ||
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c index cd15a93d9084..e7f5910a6519 100644 --- a/drivers/net/wimax/i2400m/usb.c +++ b/drivers/net/wimax/i2400m/usb.c | |||
@@ -472,7 +472,7 @@ int i2400mu_probe(struct usb_interface *iface, | |||
472 | 472 | ||
473 | /* Allocate instance [calls i2400m_netdev_setup() on it]. */ | 473 | /* Allocate instance [calls i2400m_netdev_setup() on it]. */ |
474 | result = -ENOMEM; | 474 | result = -ENOMEM; |
475 | net_dev = alloc_netdev(sizeof(*i2400mu), "wmx%d", | 475 | net_dev = alloc_netdev(sizeof(*i2400mu), "wmx%d", NET_NAME_UNKNOWN, |
476 | i2400mu_netdev_setup); | 476 | i2400mu_netdev_setup); |
477 | if (net_dev == NULL) { | 477 | if (net_dev == NULL) { |
478 | dev_err(dev, "no memory for network device instance\n"); | 478 | dev_err(dev, "no memory for network device instance\n"); |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 64747d457bb3..29d88739454b 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -2685,7 +2685,8 @@ static struct net_device *init_wifidev(struct airo_info *ai, | |||
2685 | struct net_device *ethdev) | 2685 | struct net_device *ethdev) |
2686 | { | 2686 | { |
2687 | int err; | 2687 | int err; |
2688 | struct net_device *dev = alloc_netdev(0, "wifi%d", wifi_setup); | 2688 | struct net_device *dev = alloc_netdev(0, "wifi%d", NET_NAME_UNKNOWN, |
2689 | wifi_setup); | ||
2689 | if (!dev) | 2690 | if (!dev) |
2690 | return NULL; | 2691 | return NULL; |
2691 | dev->ml_priv = ethdev->ml_priv; | 2692 | dev->ml_priv = ethdev->ml_priv; |
@@ -2785,7 +2786,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port, | |||
2785 | CapabilityRid cap_rid; | 2786 | CapabilityRid cap_rid; |
2786 | 2787 | ||
2787 | /* Create the network device object. */ | 2788 | /* Create the network device object. */ |
2788 | dev = alloc_netdev(sizeof(*ai), "", ether_setup); | 2789 | dev = alloc_netdev(sizeof(*ai), "", NET_NAME_UNKNOWN, ether_setup); |
2789 | if (!dev) { | 2790 | if (!dev) { |
2790 | airo_print_err("", "Couldn't alloc_etherdev"); | 2791 | airo_print_err("", "Couldn't alloc_etherdev"); |
2791 | return NULL; | 2792 | return NULL; |
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 0e26f4a34fda..1c4ce8e3eebe 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -3636,7 +3636,7 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, | |||
3636 | struct net_device *ndev; | 3636 | struct net_device *ndev; |
3637 | struct ath6kl_vif *vif; | 3637 | struct ath6kl_vif *vif; |
3638 | 3638 | ||
3639 | ndev = alloc_netdev(sizeof(*vif), name, ether_setup); | 3639 | ndev = alloc_netdev(sizeof(*vif), name, NET_NAME_UNKNOWN, ether_setup); |
3640 | if (!ndev) | 3640 | if (!ndev) |
3641 | return NULL; | 3641 | return NULL; |
3642 | 3642 | ||
diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index 106b6dcb773a..7afce6e8c507 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c | |||
@@ -132,7 +132,7 @@ void *wil_if_alloc(struct device *dev, void __iomem *csr) | |||
132 | ch = wdev->wiphy->bands[IEEE80211_BAND_60GHZ]->channels; | 132 | ch = wdev->wiphy->bands[IEEE80211_BAND_60GHZ]->channels; |
133 | cfg80211_chandef_create(&wdev->preset_chandef, ch, NL80211_CHAN_NO_HT); | 133 | cfg80211_chandef_create(&wdev->preset_chandef, ch, NL80211_CHAN_NO_HT); |
134 | 134 | ||
135 | ndev = alloc_netdev(0, "wlan%d", ether_setup); | 135 | ndev = alloc_netdev(0, "wlan%d", NET_NAME_UNKNOWN, ether_setup); |
136 | if (!ndev) { | 136 | if (!ndev) { |
137 | dev_err(dev, "alloc_netdev_mqs failed\n"); | 137 | dev_err(dev, "alloc_netdev_mqs failed\n"); |
138 | rc = -ENOMEM; | 138 | rc = -ENOMEM; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 09dd8c13d844..2699441d4f41 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -808,7 +808,8 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, | |||
808 | } else { | 808 | } else { |
809 | brcmf_dbg(INFO, "allocate netdev interface\n"); | 809 | brcmf_dbg(INFO, "allocate netdev interface\n"); |
810 | /* Allocate netdev, including space for private structure */ | 810 | /* Allocate netdev, including space for private structure */ |
811 | ndev = alloc_netdev(sizeof(*ifp), name, ether_setup); | 811 | ndev = alloc_netdev(sizeof(*ifp), name, NET_NAME_UNKNOWN, |
812 | ether_setup); | ||
812 | if (!ndev) | 813 | if (!ndev) |
813 | return ERR_PTR(-ENOMEM); | 814 | return ERR_PTR(-ENOMEM); |
814 | 815 | ||
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 0c02f0483d1f..569b64ecc607 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -981,7 +981,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev) | |||
981 | goto err_wdev; | 981 | goto err_wdev; |
982 | } | 982 | } |
983 | 983 | ||
984 | dev = alloc_netdev(0, "wlan%d", ether_setup); | 984 | dev = alloc_netdev(0, "wlan%d", NET_NAME_UNKNOWN, ether_setup); |
985 | if (!dev) { | 985 | if (!dev) { |
986 | dev_err(dmdev, "no memory for network device instance\n"); | 986 | dev_err(dmdev, "no memory for network device instance\n"); |
987 | goto err_adapter; | 987 | goto err_adapter; |
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c index 6fef746345bc..01a67f62696f 100644 --- a/drivers/net/wireless/libertas/mesh.c +++ b/drivers/net/wireless/libertas/mesh.c | |||
@@ -1000,7 +1000,7 @@ static int lbs_add_mesh(struct lbs_private *priv) | |||
1000 | goto done; | 1000 | goto done; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | mesh_dev = alloc_netdev(0, "msh%d", ether_setup); | 1003 | mesh_dev = alloc_netdev(0, "msh%d", NET_NAME_UNKNOWN, ether_setup); |
1004 | if (!mesh_dev) { | 1004 | if (!mesh_dev) { |
1005 | lbs_deb_mesh("init mshX device failed\n"); | 1005 | lbs_deb_mesh("init mshX device failed\n"); |
1006 | ret = -ENOMEM; | 1006 | ret = -ENOMEM; |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index eba51460a5de..5ea65fce0b83 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -2676,7 +2676,8 @@ static int __init init_mac80211_hwsim(void) | |||
2676 | goto out_free_radios; | 2676 | goto out_free_radios; |
2677 | } | 2677 | } |
2678 | 2678 | ||
2679 | hwsim_mon = alloc_netdev(0, "hwsim%d", hwsim_mon_setup); | 2679 | hwsim_mon = alloc_netdev(0, "hwsim%d", NET_NAME_UNKNOWN, |
2680 | hwsim_mon_setup); | ||
2680 | if (hwsim_mon == NULL) { | 2681 | if (hwsim_mon == NULL) { |
2681 | err = -ENOMEM; | 2682 | err = -ENOMEM; |
2682 | goto out_free_radios; | 2683 | goto out_free_radios; |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 6af135fa99f7..ca87f923c61e 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -2232,7 +2232,8 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
2232 | } | 2232 | } |
2233 | 2233 | ||
2234 | dev = alloc_netdev_mqs(sizeof(struct mwifiex_private *), name, | 2234 | dev = alloc_netdev_mqs(sizeof(struct mwifiex_private *), name, |
2235 | ether_setup, IEEE80211_NUM_ACS, 1); | 2235 | NET_NAME_UNKNOWN, ether_setup, |
2236 | IEEE80211_NUM_ACS, 1); | ||
2236 | if (!dev) { | 2237 | if (!dev) { |
2237 | wiphy_err(wiphy, "no memory available for netdevice\n"); | 2238 | wiphy_err(wiphy, "no memory available for netdevice\n"); |
2238 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; | 2239 | priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED; |
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index ef75b45e5085..bd59d9dbf27b 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -418,8 +418,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
418 | * When the guest selects the desired number, it will be updated | 418 | * When the guest selects the desired number, it will be updated |
419 | * via netif_set_real_num_*_queues(). | 419 | * via netif_set_real_num_*_queues(). |
420 | */ | 420 | */ |
421 | dev = alloc_netdev_mq(sizeof(struct xenvif), name, ether_setup, | 421 | dev = alloc_netdev_mq(sizeof(struct xenvif), name, NET_NAME_UNKNOWN, |
422 | xenvif_max_queues); | 422 | ether_setup, xenvif_max_queues); |
423 | if (dev == NULL) { | 423 | if (dev == NULL) { |
424 | pr_warn("Could not allocate netdev for %s\n", name); | 424 | pr_warn("Could not allocate netdev for %s\n", name); |
425 | return ERR_PTR(-ENOMEM); | 425 | return ERR_PTR(-ENOMEM); |
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index d837c3c5330f..fbc6701bef30 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c | |||
@@ -2915,7 +2915,7 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
2915 | "failed with error code %d\n", ret); | 2915 | "failed with error code %d\n", ret); |
2916 | goto out; | 2916 | goto out; |
2917 | } | 2917 | } |
2918 | dev = alloc_netdev(0,"claw%d",claw_init_netdevice); | 2918 | dev = alloc_netdev(0, "claw%d", NET_NAME_UNKNOWN, claw_init_netdevice); |
2919 | if (!dev) { | 2919 | if (!dev) { |
2920 | dev_warn(&cgdev->dev, | 2920 | dev_warn(&cgdev->dev, |
2921 | "Activating the CLAW device failed\n"); | 2921 | "Activating the CLAW device failed\n"); |
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 03b6ad035577..e056dd4fe44d 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
@@ -1137,9 +1137,11 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) | |||
1137 | return NULL; | 1137 | return NULL; |
1138 | 1138 | ||
1139 | if (IS_MPC(priv)) | 1139 | if (IS_MPC(priv)) |
1140 | dev = alloc_netdev(0, MPC_DEVICE_GENE, ctcm_dev_setup); | 1140 | dev = alloc_netdev(0, MPC_DEVICE_GENE, NET_NAME_UNKNOWN, |
1141 | ctcm_dev_setup); | ||
1141 | else | 1142 | else |
1142 | dev = alloc_netdev(0, CTC_DEVICE_GENE, ctcm_dev_setup); | 1143 | dev = alloc_netdev(0, CTC_DEVICE_GENE, NET_NAME_UNKNOWN, |
1144 | ctcm_dev_setup); | ||
1143 | 1145 | ||
1144 | if (!dev) { | 1146 | if (!dev) { |
1145 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_CRIT, | 1147 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_CRIT, |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index ce16d1bdb20a..0a87809c8af7 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -2015,7 +2015,7 @@ static struct net_device *netiucv_init_netdevice(char *username, char *userdata) | |||
2015 | struct net_device *dev; | 2015 | struct net_device *dev; |
2016 | 2016 | ||
2017 | dev = alloc_netdev(sizeof(struct netiucv_priv), "iucv%d", | 2017 | dev = alloc_netdev(sizeof(struct netiucv_priv), "iucv%d", |
2018 | netiucv_setup_netdevice); | 2018 | NET_NAME_UNKNOWN, netiucv_setup_netdevice); |
2019 | if (!dev) | 2019 | if (!dev) |
2020 | return NULL; | 2020 | return NULL; |
2021 | rtnl_lock(); | 2021 | rtnl_lock(); |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 5ef5b4f45758..c2679bfe7f66 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -952,10 +952,12 @@ static int qeth_l2_setup_netdev(struct qeth_card *card) | |||
952 | { | 952 | { |
953 | switch (card->info.type) { | 953 | switch (card->info.type) { |
954 | case QETH_CARD_TYPE_IQD: | 954 | case QETH_CARD_TYPE_IQD: |
955 | card->dev = alloc_netdev(0, "hsi%d", ether_setup); | 955 | card->dev = alloc_netdev(0, "hsi%d", NET_NAME_UNKNOWN, |
956 | ether_setup); | ||
956 | break; | 957 | break; |
957 | case QETH_CARD_TYPE_OSN: | 958 | case QETH_CARD_TYPE_OSN: |
958 | card->dev = alloc_netdev(0, "osn%d", ether_setup); | 959 | card->dev = alloc_netdev(0, "osn%d", NET_NAME_UNKNOWN, |
960 | ether_setup); | ||
959 | card->dev->flags |= IFF_NOARP; | 961 | card->dev->flags |= IFF_NOARP; |
960 | break; | 962 | break; |
961 | default: | 963 | default: |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 14e0b5810e8c..f8427a2c4840 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -3287,7 +3287,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) | |||
3287 | } | 3287 | } |
3288 | } | 3288 | } |
3289 | } else if (card->info.type == QETH_CARD_TYPE_IQD) { | 3289 | } else if (card->info.type == QETH_CARD_TYPE_IQD) { |
3290 | card->dev = alloc_netdev(0, "hsi%d", ether_setup); | 3290 | card->dev = alloc_netdev(0, "hsi%d", NET_NAME_UNKNOWN, |
3291 | ether_setup); | ||
3291 | if (!card->dev) | 3292 | if (!card->dev) |
3292 | return -ENODEV; | 3293 | return -ENODEV; |
3293 | card->dev->flags |= IFF_NOARP; | 3294 | card->dev->flags |= IFF_NOARP; |
diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c index 09f3d5ca75ac..85d776bbfb15 100644 --- a/drivers/staging/cxt1e1/linux.c +++ b/drivers/staging/cxt1e1/linux.c | |||
@@ -917,7 +917,8 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, unsigned long f1, | |||
917 | struct net_device *ndev; | 917 | struct net_device *ndev; |
918 | ci_t *ci; | 918 | ci_t *ci; |
919 | 919 | ||
920 | ndev = alloc_netdev(sizeof(ci_t), SBE_IFACETMPL, c4_setup); | 920 | ndev = alloc_netdev(sizeof(ci_t), SBE_IFACETMPL, NET_NAME_UNKNOWN, |
921 | c4_setup); | ||
921 | if (!ndev) { | 922 | if (!ndev) { |
922 | pr_warning("%s: no memory for struct net_device !\n", | 923 | pr_warning("%s: no memory for struct net_device !\n", |
923 | hi->devname); | 924 | hi->devname); |
diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c index 64c55b99fda4..c2268527422f 100644 --- a/drivers/staging/gdm724x/gdm_lte.c +++ b/drivers/staging/gdm724x/gdm_lte.c | |||
@@ -885,7 +885,7 @@ int register_lte_device(struct phy_dev *phy_dev, | |||
885 | 885 | ||
886 | /* Allocate netdev */ | 886 | /* Allocate netdev */ |
887 | net = alloc_netdev(sizeof(struct nic), pdn_dev_name, | 887 | net = alloc_netdev(sizeof(struct nic), pdn_dev_name, |
888 | ether_setup); | 888 | NET_NAME_UNKNOWN, ether_setup); |
889 | if (net == NULL) { | 889 | if (net == NULL) { |
890 | pr_err("alloc_netdev failed\n"); | 890 | pr_err("alloc_netdev failed\n"); |
891 | ret = -ENOMEM; | 891 | ret = -ENOMEM; |
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index e5e511585122..a9a6fc51024b 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c | |||
@@ -886,7 +886,8 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev) | |||
886 | struct net_device *dev; | 886 | struct net_device *dev; |
887 | int ret; | 887 | int ret; |
888 | 888 | ||
889 | dev = alloc_netdev(sizeof(*nic), "wm%d", ether_setup); | 889 | dev = alloc_netdev(sizeof(*nic), "wm%d", NET_NAME_UNKNOWN, |
890 | ether_setup); | ||
890 | 891 | ||
891 | if (dev == NULL) { | 892 | if (dev == NULL) { |
892 | pr_err("alloc_etherdev failed\n"); | 893 | pr_err("alloc_etherdev failed\n"); |
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c index 8392d4d1d5ed..0814bfd68b2e 100644 --- a/drivers/staging/vt6655/wpactl.c +++ b/drivers/staging/vt6655/wpactl.c | |||
@@ -89,7 +89,8 @@ static int wpa_init_wpadev(PSDevice pDevice) | |||
89 | struct net_device *dev = pDevice->dev; | 89 | struct net_device *dev = pDevice->dev; |
90 | int ret = 0; | 90 | int ret = 0; |
91 | 91 | ||
92 | pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", wpadev_setup); | 92 | pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", |
93 | NET_NAME_UNKNOWN, wpadev_setup); | ||
93 | if (pDevice->wpadev == NULL) | 94 | if (pDevice->wpadev == NULL) |
94 | return -ENOMEM; | 95 | return -ENOMEM; |
95 | 96 | ||
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 00b186c59725..6c78f917e24a 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c | |||
@@ -769,7 +769,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev) | |||
769 | 769 | ||
770 | /* Allocate and initialize the struct device */ | 770 | /* Allocate and initialize the struct device */ |
771 | netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d", | 771 | netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d", |
772 | ether_setup); | 772 | NET_NAME_UNKNOWN, ether_setup); |
773 | if (netdev == NULL) { | 773 | if (netdev == NULL) { |
774 | dev_err(physdev, "Failed to alloc netdev.\n"); | 774 | dev_err(physdev, "Failed to alloc netdev.\n"); |
775 | wlan_free_wiphy(wiphy); | 775 | wlan_free_wiphy(wiphy); |
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 2ebe47b78a3e..cde3ab97900f 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c | |||
@@ -2789,9 +2789,8 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc) | |||
2789 | netname = "gsm%d"; | 2789 | netname = "gsm%d"; |
2790 | if (nc->if_name[0] != '\0') | 2790 | if (nc->if_name[0] != '\0') |
2791 | netname = nc->if_name; | 2791 | netname = nc->if_name; |
2792 | net = alloc_netdev(sizeof(struct gsm_mux_net), | 2792 | net = alloc_netdev(sizeof(struct gsm_mux_net), netname, |
2793 | netname, | 2793 | NET_NAME_UNKNOWN, gsm_mux_net_init); |
2794 | gsm_mux_net_init); | ||
2795 | if (!net) { | 2794 | if (!net) { |
2796 | pr_err("alloc_netdev failed"); | 2795 | pr_err("alloc_netdev failed"); |
2797 | return -ENOMEM; | 2796 | return -ENOMEM; |
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c index f2b781773eed..b9cfc1571d71 100644 --- a/drivers/usb/gadget/f_phonet.c +++ b/drivers/usb/gadget/f_phonet.c | |||
@@ -721,7 +721,8 @@ struct net_device *gphonet_setup_default(void) | |||
721 | struct phonet_port *port; | 721 | struct phonet_port *port; |
722 | 722 | ||
723 | /* Create net device */ | 723 | /* Create net device */ |
724 | dev = alloc_netdev(sizeof(*port), "upnlink%d", pn_net_setup); | 724 | dev = alloc_netdev(sizeof(*port), "upnlink%d", NET_NAME_UNKNOWN, |
725 | pn_net_setup); | ||
725 | if (!dev) | 726 | if (!dev) |
726 | return ERR_PTR(-ENOMEM); | 727 | return ERR_PTR(-ENOMEM); |
727 | 728 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9be34732142f..15ed750458ad 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2991,13 +2991,15 @@ void ether_setup(struct net_device *dev); | |||
2991 | 2991 | ||
2992 | /* Support for loadable net-drivers */ | 2992 | /* Support for loadable net-drivers */ |
2993 | struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | 2993 | struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, |
2994 | unsigned char name_assign_type, | ||
2994 | void (*setup)(struct net_device *), | 2995 | void (*setup)(struct net_device *), |
2995 | unsigned int txqs, unsigned int rxqs); | 2996 | unsigned int txqs, unsigned int rxqs); |
2996 | #define alloc_netdev(sizeof_priv, name, setup) \ | 2997 | #define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ |
2997 | alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) | 2998 | alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1) |
2998 | 2999 | ||
2999 | #define alloc_netdev_mq(sizeof_priv, name, setup, count) \ | 3000 | #define alloc_netdev_mq(sizeof_priv, name, name_assign_type, setup, count) \ |
3000 | alloc_netdev_mqs(sizeof_priv, name, setup, count, count) | 3001 | alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, count, \ |
3002 | count) | ||
3001 | 3003 | ||
3002 | int register_netdev(struct net_device *dev); | 3004 | int register_netdev(struct net_device *dev); |
3003 | void unregister_netdev(struct net_device *dev); | 3005 | void unregister_netdev(struct net_device *dev); |
diff --git a/net/802/fc.c b/net/802/fc.c index 05eea6b98bb8..7c174b6750cd 100644 --- a/net/802/fc.c +++ b/net/802/fc.c | |||
@@ -126,6 +126,6 @@ static void fc_setup(struct net_device *dev) | |||
126 | */ | 126 | */ |
127 | struct net_device *alloc_fcdev(int sizeof_priv) | 127 | struct net_device *alloc_fcdev(int sizeof_priv) |
128 | { | 128 | { |
129 | return alloc_netdev(sizeof_priv, "fc%d", fc_setup); | 129 | return alloc_netdev(sizeof_priv, "fc%d", NET_NAME_UNKNOWN, fc_setup); |
130 | } | 130 | } |
131 | EXPORT_SYMBOL(alloc_fcdev); | 131 | EXPORT_SYMBOL(alloc_fcdev); |
diff --git a/net/802/fddi.c b/net/802/fddi.c index 9cda40661e0d..59e7346f1193 100644 --- a/net/802/fddi.c +++ b/net/802/fddi.c | |||
@@ -207,7 +207,8 @@ static void fddi_setup(struct net_device *dev) | |||
207 | */ | 207 | */ |
208 | struct net_device *alloc_fddidev(int sizeof_priv) | 208 | struct net_device *alloc_fddidev(int sizeof_priv) |
209 | { | 209 | { |
210 | return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup); | 210 | return alloc_netdev(sizeof_priv, "fddi%d", NET_NAME_UNKNOWN, |
211 | fddi_setup); | ||
211 | } | 212 | } |
212 | EXPORT_SYMBOL(alloc_fddidev); | 213 | EXPORT_SYMBOL(alloc_fddidev); |
213 | 214 | ||
diff --git a/net/802/hippi.c b/net/802/hippi.c index 5ff2a718ddca..2e03f8259dd5 100644 --- a/net/802/hippi.c +++ b/net/802/hippi.c | |||
@@ -228,7 +228,8 @@ static void hippi_setup(struct net_device *dev) | |||
228 | 228 | ||
229 | struct net_device *alloc_hippi_dev(int sizeof_priv) | 229 | struct net_device *alloc_hippi_dev(int sizeof_priv) |
230 | { | 230 | { |
231 | return alloc_netdev(sizeof_priv, "hip%d", hippi_setup); | 231 | return alloc_netdev(sizeof_priv, "hip%d", NET_NAME_UNKNOWN, |
232 | hippi_setup); | ||
232 | } | 233 | } |
233 | 234 | ||
234 | EXPORT_SYMBOL(alloc_hippi_dev); | 235 | EXPORT_SYMBOL(alloc_hippi_dev); |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 44ebd5c2cd4a..cba9c212a730 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -250,7 +250,8 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id) | |||
250 | snprintf(name, IFNAMSIZ, "vlan%.4i", vlan_id); | 250 | snprintf(name, IFNAMSIZ, "vlan%.4i", vlan_id); |
251 | } | 251 | } |
252 | 252 | ||
253 | new_dev = alloc_netdev(sizeof(struct vlan_dev_priv), name, vlan_setup); | 253 | new_dev = alloc_netdev(sizeof(struct vlan_dev_priv), name, |
254 | NET_NAME_UNKNOWN, vlan_setup); | ||
254 | 255 | ||
255 | if (new_dev == NULL) | 256 | if (new_dev == NULL) |
256 | return -ENOBUFS; | 257 | return -ENOBUFS; |
diff --git a/net/appletalk/dev.c b/net/appletalk/dev.c index 6c8016f61866..e4158b8b926d 100644 --- a/net/appletalk/dev.c +++ b/net/appletalk/dev.c | |||
@@ -39,6 +39,7 @@ static void ltalk_setup(struct net_device *dev) | |||
39 | 39 | ||
40 | struct net_device *alloc_ltalkdev(int sizeof_priv) | 40 | struct net_device *alloc_ltalkdev(int sizeof_priv) |
41 | { | 41 | { |
42 | return alloc_netdev(sizeof_priv, "lt%d", ltalk_setup); | 42 | return alloc_netdev(sizeof_priv, "lt%d", NET_NAME_UNKNOWN, |
43 | ltalk_setup); | ||
43 | } | 44 | } |
44 | EXPORT_SYMBOL(alloc_ltalkdev); | 45 | EXPORT_SYMBOL(alloc_ltalkdev); |
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 403e71fa88fe..cc78538d163b 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -682,8 +682,8 @@ static int br2684_create(void __user *arg) | |||
682 | 682 | ||
683 | netdev = alloc_netdev(sizeof(struct br2684_dev), | 683 | netdev = alloc_netdev(sizeof(struct br2684_dev), |
684 | ni.ifname[0] ? ni.ifname : "nas%d", | 684 | ni.ifname[0] ? ni.ifname : "nas%d", |
685 | (payload == p_routed) ? | 685 | NET_NAME_UNKNOWN, |
686 | br2684_setup_routed : br2684_setup); | 686 | (payload == p_routed) ? br2684_setup_routed : br2684_setup); |
687 | if (!netdev) | 687 | if (!netdev) |
688 | return -ENOMEM; | 688 | return -ENOMEM; |
689 | 689 | ||
diff --git a/net/atm/clip.c b/net/atm/clip.c index ba291ce4bdff..46339040fef0 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -520,7 +520,8 @@ static int clip_create(int number) | |||
520 | if (PRIV(dev)->number >= number) | 520 | if (PRIV(dev)->number >= number) |
521 | number = PRIV(dev)->number + 1; | 521 | number = PRIV(dev)->number + 1; |
522 | } | 522 | } |
523 | dev = alloc_netdev(sizeof(struct clip_priv), "", clip_setup); | 523 | dev = alloc_netdev(sizeof(struct clip_priv), "", NET_NAME_UNKNOWN, |
524 | clip_setup); | ||
524 | if (!dev) | 525 | if (!dev) |
525 | return -ENOMEM; | 526 | return -ENOMEM; |
526 | clip_priv = PRIV(dev); | 527 | clip_priv = PRIV(dev); |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index e7ee65dc20bf..d551e6302cf3 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -895,7 +895,7 @@ struct net_device *batadv_softif_create(const char *name) | |||
895 | int ret; | 895 | int ret; |
896 | 896 | ||
897 | soft_iface = alloc_netdev(sizeof(struct batadv_priv), name, | 897 | soft_iface = alloc_netdev(sizeof(struct batadv_priv), name, |
898 | batadv_softif_init_early); | 898 | NET_NAME_UNKNOWN, batadv_softif_init_early); |
899 | if (!soft_iface) | 899 | if (!soft_iface) |
900 | return NULL; | 900 | return NULL; |
901 | 901 | ||
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 5a7f81df603c..206b65ccd5b8 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c | |||
@@ -712,7 +712,7 @@ static int setup_netdev(struct l2cap_chan *chan, struct lowpan_dev **dev) | |||
712 | unsigned long flags; | 712 | unsigned long flags; |
713 | 713 | ||
714 | netdev = alloc_netdev(sizeof(struct lowpan_dev), IFACE_NAME_TEMPLATE, | 714 | netdev = alloc_netdev(sizeof(struct lowpan_dev), IFACE_NAME_TEMPLATE, |
715 | netdev_setup); | 715 | NET_NAME_UNKNOWN, netdev_setup); |
716 | if (!netdev) | 716 | if (!netdev) |
717 | return -ENOMEM; | 717 | return -ENOMEM; |
718 | 718 | ||
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index a841d3e776c5..85bcc21e84d2 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
@@ -538,8 +538,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) | |||
538 | 538 | ||
539 | /* session struct allocated as private part of net_device */ | 539 | /* session struct allocated as private part of net_device */ |
540 | dev = alloc_netdev(sizeof(struct bnep_session), | 540 | dev = alloc_netdev(sizeof(struct bnep_session), |
541 | (*req->device) ? req->device : "bnep%d", | 541 | (*req->device) ? req->device : "bnep%d", |
542 | bnep_net_setup); | 542 | NET_NAME_UNKNOWN, |
543 | bnep_net_setup); | ||
543 | if (!dev) | 544 | if (!dev) |
544 | return -ENOMEM; | 545 | return -ENOMEM; |
545 | 546 | ||
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 3eca3fdf8fe1..078d336a1f37 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -344,7 +344,7 @@ int br_add_bridge(struct net *net, const char *name) | |||
344 | struct net_device *dev; | 344 | struct net_device *dev; |
345 | int res; | 345 | int res; |
346 | 346 | ||
347 | dev = alloc_netdev(sizeof(struct net_bridge), name, | 347 | dev = alloc_netdev(sizeof(struct net_bridge), name, NET_NAME_UNKNOWN, |
348 | br_dev_setup); | 348 | br_dev_setup); |
349 | 349 | ||
350 | if (!dev) | 350 | if (!dev) |
diff --git a/net/core/dev.c b/net/core/dev.c index 38793fb84a35..2c98f10ee62a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -6441,17 +6441,19 @@ void netdev_freemem(struct net_device *dev) | |||
6441 | 6441 | ||
6442 | /** | 6442 | /** |
6443 | * alloc_netdev_mqs - allocate network device | 6443 | * alloc_netdev_mqs - allocate network device |
6444 | * @sizeof_priv: size of private data to allocate space for | 6444 | * @sizeof_priv: size of private data to allocate space for |
6445 | * @name: device name format string | 6445 | * @name: device name format string |
6446 | * @setup: callback to initialize device | 6446 | * @name_assign_type: origin of device name |
6447 | * @txqs: the number of TX subqueues to allocate | 6447 | * @setup: callback to initialize device |
6448 | * @rxqs: the number of RX subqueues to allocate | 6448 | * @txqs: the number of TX subqueues to allocate |
6449 | * @rxqs: the number of RX subqueues to allocate | ||
6449 | * | 6450 | * |
6450 | * Allocates a struct net_device with private data area for driver use | 6451 | * Allocates a struct net_device with private data area for driver use |
6451 | * and performs basic initialization. Also allocates subqueue structs | 6452 | * and performs basic initialization. Also allocates subqueue structs |
6452 | * for each queue on the device. | 6453 | * for each queue on the device. |
6453 | */ | 6454 | */ |
6454 | struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | 6455 | struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, |
6456 | unsigned char name_assign_type, | ||
6455 | void (*setup)(struct net_device *), | 6457 | void (*setup)(struct net_device *), |
6456 | unsigned int txqs, unsigned int rxqs) | 6458 | unsigned int txqs, unsigned int rxqs) |
6457 | { | 6459 | { |
@@ -6530,6 +6532,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, | |||
6530 | #endif | 6532 | #endif |
6531 | 6533 | ||
6532 | strcpy(dev->name, name); | 6534 | strcpy(dev->name, name); |
6535 | dev->name_assign_type = name_assign_type; | ||
6533 | dev->group = INIT_NETDEV_GROUP; | 6536 | dev->group = INIT_NETDEV_GROUP; |
6534 | if (!dev->ethtool_ops) | 6537 | if (!dev->ethtool_ops) |
6535 | dev->ethtool_ops = &default_ethtool_ops; | 6538 | dev->ethtool_ops = &default_ethtool_ops; |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 1f8a59e02c48..599864322de8 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1828,8 +1828,8 @@ struct net_device *rtnl_create_link(struct net *net, | |||
1828 | num_rx_queues = ops->get_num_rx_queues(); | 1828 | num_rx_queues = ops->get_num_rx_queues(); |
1829 | 1829 | ||
1830 | err = -ENOMEM; | 1830 | err = -ENOMEM; |
1831 | dev = alloc_netdev_mqs(ops->priv_size, ifname, ops->setup, | 1831 | dev = alloc_netdev_mqs(ops->priv_size, ifname, NET_NAME_UNKNOWN, |
1832 | num_tx_queues, num_rx_queues); | 1832 | ops->setup, num_tx_queues, num_rx_queues); |
1833 | if (!dev) | 1833 | if (!dev) |
1834 | goto err; | 1834 | goto err; |
1835 | 1835 | ||
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 64c5af0a10dd..45a1e34c89e0 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -340,8 +340,8 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent, | |||
340 | struct dsa_slave_priv *p; | 340 | struct dsa_slave_priv *p; |
341 | int ret; | 341 | int ret; |
342 | 342 | ||
343 | slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv), | 343 | slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv), name, |
344 | name, ether_setup); | 344 | NET_NAME_UNKNOWN, ether_setup); |
345 | if (slave_dev == NULL) | 345 | if (slave_dev == NULL) |
346 | return slave_dev; | 346 | return slave_dev; |
347 | 347 | ||
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 5dc638cad2e1..f405e0592407 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -390,7 +390,8 @@ EXPORT_SYMBOL(ether_setup); | |||
390 | struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, | 390 | struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, |
391 | unsigned int rxqs) | 391 | unsigned int rxqs) |
392 | { | 392 | { |
393 | return alloc_netdev_mqs(sizeof_priv, "eth%d", ether_setup, txqs, rxqs); | 393 | return alloc_netdev_mqs(sizeof_priv, "eth%d", NET_NAME_UNKNOWN, |
394 | ether_setup, txqs, rxqs); | ||
394 | } | 395 | } |
395 | EXPORT_SYMBOL(alloc_etherdev_mqs); | 396 | EXPORT_SYMBOL(alloc_etherdev_mqs); |
396 | 397 | ||
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index 54b6731dab55..0157a7af20a8 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -301,7 +301,7 @@ static struct net_device *__ip_tunnel_create(struct net *net, | |||
301 | } | 301 | } |
302 | 302 | ||
303 | ASSERT_RTNL(); | 303 | ASSERT_RTNL(); |
304 | dev = alloc_netdev(ops->priv_size, name, ops->setup); | 304 | dev = alloc_netdev(ops->priv_size, name, NET_NAME_UNKNOWN, ops->setup); |
305 | if (!dev) { | 305 | if (!dev) { |
306 | err = -ENOMEM; | 306 | err = -ENOMEM; |
307 | goto failed; | 307 | goto failed; |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 65bcaa789043..c8034587859d 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -500,7 +500,7 @@ static struct net_device *ipmr_reg_vif(struct net *net, struct mr_table *mrt) | |||
500 | else | 500 | else |
501 | sprintf(name, "pimreg%u", mrt->id); | 501 | sprintf(name, "pimreg%u", mrt->id); |
502 | 502 | ||
503 | dev = alloc_netdev(0, name, reg_vif_setup); | 503 | dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, reg_vif_setup); |
504 | 504 | ||
505 | if (dev == NULL) | 505 | if (dev == NULL) |
506 | return NULL; | 506 | return NULL; |
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 365b2b6f3942..5f19dfbc4c6a 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -322,7 +322,8 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net, | |||
322 | else | 322 | else |
323 | strcpy(name, "ip6gre%d"); | 323 | strcpy(name, "ip6gre%d"); |
324 | 324 | ||
325 | dev = alloc_netdev(sizeof(*t), name, ip6gre_tunnel_setup); | 325 | dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN, |
326 | ip6gre_tunnel_setup); | ||
326 | if (!dev) | 327 | if (!dev) |
327 | return NULL; | 328 | return NULL; |
328 | 329 | ||
@@ -1326,7 +1327,8 @@ static int __net_init ip6gre_init_net(struct net *net) | |||
1326 | int err; | 1327 | int err; |
1327 | 1328 | ||
1328 | ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6gre0", | 1329 | ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6gre0", |
1329 | ip6gre_tunnel_setup); | 1330 | NET_NAME_UNKNOWN, |
1331 | ip6gre_tunnel_setup); | ||
1330 | if (!ign->fb_tunnel_dev) { | 1332 | if (!ign->fb_tunnel_dev) { |
1331 | err = -ENOMEM; | 1333 | err = -ENOMEM; |
1332 | goto err_alloc_dev; | 1334 | goto err_alloc_dev; |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 51a1eb185ea7..f9de5a695072 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -315,7 +315,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p) | |||
315 | else | 315 | else |
316 | sprintf(name, "ip6tnl%%d"); | 316 | sprintf(name, "ip6tnl%%d"); |
317 | 317 | ||
318 | dev = alloc_netdev(sizeof (*t), name, ip6_tnl_dev_setup); | 318 | dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN, |
319 | ip6_tnl_dev_setup); | ||
319 | if (dev == NULL) | 320 | if (dev == NULL) |
320 | goto failed; | 321 | goto failed; |
321 | 322 | ||
@@ -1773,7 +1774,7 @@ static int __net_init ip6_tnl_init_net(struct net *net) | |||
1773 | 1774 | ||
1774 | err = -ENOMEM; | 1775 | err = -ENOMEM; |
1775 | ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6tnl0", | 1776 | ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6tnl0", |
1776 | ip6_tnl_dev_setup); | 1777 | NET_NAME_UNKNOWN, ip6_tnl_dev_setup); |
1777 | 1778 | ||
1778 | if (!ip6n->fb_tnl_dev) | 1779 | if (!ip6n->fb_tnl_dev) |
1779 | goto err_alloc_dev; | 1780 | goto err_alloc_dev; |
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index 9aaa6bb229e4..17ee4fc32dfe 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c | |||
@@ -204,7 +204,7 @@ static struct ip6_tnl *vti6_tnl_create(struct net *net, struct __ip6_tnl_parm *p | |||
204 | else | 204 | else |
205 | sprintf(name, "ip6_vti%%d"); | 205 | sprintf(name, "ip6_vti%%d"); |
206 | 206 | ||
207 | dev = alloc_netdev(sizeof(*t), name, vti6_dev_setup); | 207 | dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN, vti6_dev_setup); |
208 | if (dev == NULL) | 208 | if (dev == NULL) |
209 | goto failed; | 209 | goto failed; |
210 | 210 | ||
@@ -1020,7 +1020,7 @@ static int __net_init vti6_init_net(struct net *net) | |||
1020 | 1020 | ||
1021 | err = -ENOMEM; | 1021 | err = -ENOMEM; |
1022 | ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6_vti0", | 1022 | ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6_vti0", |
1023 | vti6_dev_setup); | 1023 | NET_NAME_UNKNOWN, vti6_dev_setup); |
1024 | 1024 | ||
1025 | if (!ip6n->fb_tnl_dev) | 1025 | if (!ip6n->fb_tnl_dev) |
1026 | goto err_alloc_dev; | 1026 | goto err_alloc_dev; |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 8250474ab7dc..f9a3fd320d1d 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -744,7 +744,7 @@ static struct net_device *ip6mr_reg_vif(struct net *net, struct mr6_table *mrt) | |||
744 | else | 744 | else |
745 | sprintf(name, "pim6reg%u", mrt->id); | 745 | sprintf(name, "pim6reg%u", mrt->id); |
746 | 746 | ||
747 | dev = alloc_netdev(0, name, reg_vif_setup); | 747 | dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, reg_vif_setup); |
748 | if (dev == NULL) | 748 | if (dev == NULL) |
749 | return NULL; | 749 | return NULL; |
750 | 750 | ||
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 4f408176dc64..2e9ba035fb5f 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -250,7 +250,8 @@ static struct ip_tunnel *ipip6_tunnel_locate(struct net *net, | |||
250 | else | 250 | else |
251 | strcpy(name, "sit%d"); | 251 | strcpy(name, "sit%d"); |
252 | 252 | ||
253 | dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup); | 253 | dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN, |
254 | ipip6_tunnel_setup); | ||
254 | if (dev == NULL) | 255 | if (dev == NULL) |
255 | return NULL; | 256 | return NULL; |
256 | 257 | ||
@@ -1729,6 +1730,7 @@ static int __net_init sit_init_net(struct net *net) | |||
1729 | sitn->tunnels[3] = sitn->tunnels_r_l; | 1730 | sitn->tunnels[3] = sitn->tunnels_r_l; |
1730 | 1731 | ||
1731 | sitn->fb_tunnel_dev = alloc_netdev(sizeof(struct ip_tunnel), "sit0", | 1732 | sitn->fb_tunnel_dev = alloc_netdev(sizeof(struct ip_tunnel), "sit0", |
1733 | NET_NAME_UNKNOWN, | ||
1732 | ipip6_tunnel_setup); | 1734 | ipip6_tunnel_setup); |
1733 | if (!sitn->fb_tunnel_dev) { | 1735 | if (!sitn->fb_tunnel_dev) { |
1734 | err = -ENOMEM; | 1736 | err = -ENOMEM; |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 365b895da84b..9e0d909390fd 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
@@ -293,7 +293,8 @@ static void irda_device_setup(struct net_device *dev) | |||
293 | */ | 293 | */ |
294 | struct net_device *alloc_irdadev(int sizeof_priv) | 294 | struct net_device *alloc_irdadev(int sizeof_priv) |
295 | { | 295 | { |
296 | return alloc_netdev(sizeof_priv, "irda%d", irda_device_setup); | 296 | return alloc_netdev(sizeof_priv, "irda%d", NET_NAME_UNKNOWN, |
297 | irda_device_setup); | ||
297 | } | 298 | } |
298 | EXPORT_SYMBOL(alloc_irdadev); | 299 | EXPORT_SYMBOL(alloc_irdadev); |
299 | 300 | ||
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c index ffcec225b5d9..dc13f1a45f2f 100644 --- a/net/irda/irlan/irlan_eth.c +++ b/net/irda/irlan/irlan_eth.c | |||
@@ -96,7 +96,7 @@ static void irlan_eth_setup(struct net_device *dev) | |||
96 | */ | 96 | */ |
97 | struct net_device *alloc_irlandev(const char *name) | 97 | struct net_device *alloc_irlandev(const char *name) |
98 | { | 98 | { |
99 | return alloc_netdev(sizeof(struct irlan_cb), name, | 99 | return alloc_netdev(sizeof(struct irlan_cb), name, NET_NAME_UNKNOWN, |
100 | irlan_eth_setup); | 100 | irlan_eth_setup); |
101 | } | 101 | } |
102 | 102 | ||
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index 76125c57ee6d..edb78e69efe4 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c | |||
@@ -246,7 +246,8 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p | |||
246 | goto out; | 246 | goto out; |
247 | } | 247 | } |
248 | 248 | ||
249 | dev = alloc_netdev(sizeof(*priv), name, l2tp_eth_dev_setup); | 249 | dev = alloc_netdev(sizeof(*priv), name, NET_NAME_UNKNOWN, |
250 | l2tp_eth_dev_setup); | ||
250 | if (!dev) { | 251 | if (!dev) { |
251 | rc = -ENOMEM; | 252 | rc = -ENOMEM; |
252 | goto out_del_session; | 253 | goto out_del_session; |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index bbf51b2f0651..4edfc7c1524f 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -1624,9 +1624,9 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
1624 | if (local->hw.queues >= IEEE80211_NUM_ACS) | 1624 | if (local->hw.queues >= IEEE80211_NUM_ACS) |
1625 | txqs = IEEE80211_NUM_ACS; | 1625 | txqs = IEEE80211_NUM_ACS; |
1626 | 1626 | ||
1627 | ndev = alloc_netdev_mqs(sizeof(*sdata) + | 1627 | ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size, |
1628 | local->hw.vif_data_size, | 1628 | name, NET_NAME_UNKNOWN, |
1629 | name, ieee80211_if_setup, txqs, 1); | 1629 | ieee80211_if_setup, txqs, 1); |
1630 | if (!ndev) | 1630 | if (!ndev) |
1631 | return -ENOMEM; | 1631 | return -ENOMEM; |
1632 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); | 1632 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); |
diff --git a/net/mac802154/ieee802154_dev.c b/net/mac802154/ieee802154_dev.c index 9b54370f5e87..b36b2b996578 100644 --- a/net/mac802154/ieee802154_dev.c +++ b/net/mac802154/ieee802154_dev.c | |||
@@ -167,11 +167,13 @@ mac802154_add_iface(struct wpan_phy *phy, const char *name, int type) | |||
167 | switch (type) { | 167 | switch (type) { |
168 | case IEEE802154_DEV_MONITOR: | 168 | case IEEE802154_DEV_MONITOR: |
169 | dev = alloc_netdev(sizeof(struct mac802154_sub_if_data), | 169 | dev = alloc_netdev(sizeof(struct mac802154_sub_if_data), |
170 | name, mac802154_monitor_setup); | 170 | name, NET_NAME_UNKNOWN, |
171 | mac802154_monitor_setup); | ||
171 | break; | 172 | break; |
172 | case IEEE802154_DEV_WPAN: | 173 | case IEEE802154_DEV_WPAN: |
173 | dev = alloc_netdev(sizeof(struct mac802154_sub_if_data), | 174 | dev = alloc_netdev(sizeof(struct mac802154_sub_if_data), |
174 | name, mac802154_wpan_setup); | 175 | name, NET_NAME_UNKNOWN, |
176 | mac802154_wpan_setup); | ||
175 | break; | 177 | break; |
176 | default: | 178 | default: |
177 | dev = NULL; | 179 | dev = NULL; |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index ede50d197e10..71cf1bffea06 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1418,7 +1418,7 @@ static int __init nr_proto_init(void) | |||
1418 | struct net_device *dev; | 1418 | struct net_device *dev; |
1419 | 1419 | ||
1420 | sprintf(name, "nr%d", i); | 1420 | sprintf(name, "nr%d", i); |
1421 | dev = alloc_netdev(0, name, nr_setup); | 1421 | dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, nr_setup); |
1422 | if (!dev) { | 1422 | if (!dev) { |
1423 | printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); | 1423 | printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); |
1424 | goto fail; | 1424 | goto fail; |
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c index 295471a66c78..bd658555afdf 100644 --- a/net/openvswitch/vport-internal_dev.c +++ b/net/openvswitch/vport-internal_dev.c | |||
@@ -165,7 +165,8 @@ static struct vport *internal_dev_create(const struct vport_parms *parms) | |||
165 | netdev_vport = netdev_vport_priv(vport); | 165 | netdev_vport = netdev_vport_priv(vport); |
166 | 166 | ||
167 | netdev_vport->dev = alloc_netdev(sizeof(struct internal_dev), | 167 | netdev_vport->dev = alloc_netdev(sizeof(struct internal_dev), |
168 | parms->name, do_setup); | 168 | parms->name, NET_NAME_UNKNOWN, |
169 | do_setup); | ||
169 | if (!netdev_vport->dev) { | 170 | if (!netdev_vport->dev) { |
170 | err = -ENOMEM; | 171 | err = -ENOMEM; |
171 | goto error_free_vport; | 172 | goto error_free_vport; |
diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c index 66dc65e7c6a1..e9a83a637185 100644 --- a/net/phonet/pep-gprs.c +++ b/net/phonet/pep-gprs.c | |||
@@ -267,7 +267,7 @@ int gprs_attach(struct sock *sk) | |||
267 | return -EINVAL; /* need packet boundaries */ | 267 | return -EINVAL; /* need packet boundaries */ |
268 | 268 | ||
269 | /* Create net device */ | 269 | /* Create net device */ |
270 | dev = alloc_netdev(sizeof(*gp), ifname, gprs_setup); | 270 | dev = alloc_netdev(sizeof(*gp), ifname, NET_NAME_UNKNOWN, gprs_setup); |
271 | if (!dev) | 271 | if (!dev) |
272 | return -ENOMEM; | 272 | return -ENOMEM; |
273 | gp = netdev_priv(dev); | 273 | gp = netdev_priv(dev); |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 8451c8cdc9de..a85c1a086ae4 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1538,7 +1538,7 @@ static int __init rose_proto_init(void) | |||
1538 | char name[IFNAMSIZ]; | 1538 | char name[IFNAMSIZ]; |
1539 | 1539 | ||
1540 | sprintf(name, "rose%d", i); | 1540 | sprintf(name, "rose%d", i); |
1541 | dev = alloc_netdev(0, name, rose_setup); | 1541 | dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, rose_setup); |
1542 | if (!dev) { | 1542 | if (!dev) { |
1543 | printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n"); | 1543 | printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n"); |
1544 | rc = -ENOMEM; | 1544 | rc = -ENOMEM; |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 474167162947..bd33793b527e 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -485,8 +485,8 @@ static int __init teql_init(void) | |||
485 | struct net_device *dev; | 485 | struct net_device *dev; |
486 | struct teql_master *master; | 486 | struct teql_master *master; |
487 | 487 | ||
488 | dev = alloc_netdev(sizeof(struct teql_master), | 488 | dev = alloc_netdev(sizeof(struct teql_master), "teql%d", |
489 | "teql%d", teql_master_setup); | 489 | NET_NAME_UNKNOWN, teql_master_setup); |
490 | if (!dev) { | 490 | if (!dev) { |
491 | err = -ENOMEM; | 491 | err = -ENOMEM; |
492 | break; | 492 | break; |