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 /drivers | |
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>
Diffstat (limited to 'drivers')
64 files changed, 112 insertions, 82 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 | ||