diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ibmveth.c | 12 | ||||
-rw-r--r-- | drivers/net/iseries_veth.c | 19 | ||||
-rw-r--r-- | drivers/net/wan/cosa.c | 5 |
3 files changed, 15 insertions, 21 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 7d7758f3ad8c..57772bebff56 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -1179,13 +1179,15 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
1179 | 1179 | ||
1180 | for(i = 0; i<IbmVethNumBufferPools; i++) { | 1180 | for(i = 0; i<IbmVethNumBufferPools; i++) { |
1181 | struct kobject *kobj = &adapter->rx_buff_pool[i].kobj; | 1181 | struct kobject *kobj = &adapter->rx_buff_pool[i].kobj; |
1182 | int error; | ||
1183 | |||
1182 | ibmveth_init_buffer_pool(&adapter->rx_buff_pool[i], i, | 1184 | ibmveth_init_buffer_pool(&adapter->rx_buff_pool[i], i, |
1183 | pool_count[i], pool_size[i], | 1185 | pool_count[i], pool_size[i], |
1184 | pool_active[i]); | 1186 | pool_active[i]); |
1185 | kobj->parent = &dev->dev.kobj; | 1187 | error = kobject_init_and_add(kobj, &ktype_veth_pool, |
1186 | kobject_set_name(kobj, "pool%d", i); | 1188 | &dev->dev.kobj, "pool%d", i); |
1187 | kobj->ktype = &ktype_veth_pool; | 1189 | if (!error) |
1188 | kobject_register(kobj); | 1190 | kobject_uevent(kobj, KOBJ_ADD); |
1189 | } | 1191 | } |
1190 | 1192 | ||
1191 | ibmveth_debug_printk("adapter @ 0x%p\n", adapter); | 1193 | ibmveth_debug_printk("adapter @ 0x%p\n", adapter); |
@@ -1234,7 +1236,7 @@ static int __devexit ibmveth_remove(struct vio_dev *dev) | |||
1234 | int i; | 1236 | int i; |
1235 | 1237 | ||
1236 | for(i = 0; i<IbmVethNumBufferPools; i++) | 1238 | for(i = 0; i<IbmVethNumBufferPools; i++) |
1237 | kobject_unregister(&adapter->rx_buff_pool[i].kobj); | 1239 | kobject_put(&adapter->rx_buff_pool[i].kobj); |
1238 | 1240 | ||
1239 | unregister_netdev(netdev); | 1241 | unregister_netdev(netdev); |
1240 | 1242 | ||
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 97bd9dc2e52e..419861cbc65e 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -815,7 +815,7 @@ static int veth_init_connection(u8 rlp) | |||
815 | { | 815 | { |
816 | struct veth_lpar_connection *cnx; | 816 | struct veth_lpar_connection *cnx; |
817 | struct veth_msg *msgs; | 817 | struct veth_msg *msgs; |
818 | int i, rc; | 818 | int i; |
819 | 819 | ||
820 | if ( (rlp == this_lp) | 820 | if ( (rlp == this_lp) |
821 | || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) | 821 | || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) |
@@ -844,11 +844,7 @@ static int veth_init_connection(u8 rlp) | |||
844 | 844 | ||
845 | /* This gets us 1 reference, which is held on behalf of the driver | 845 | /* This gets us 1 reference, which is held on behalf of the driver |
846 | * infrastructure. It's released at module unload. */ | 846 | * infrastructure. It's released at module unload. */ |
847 | kobject_init(&cnx->kobject); | 847 | kobject_init(&cnx->kobject, &veth_lpar_connection_ktype); |
848 | cnx->kobject.ktype = &veth_lpar_connection_ktype; | ||
849 | rc = kobject_set_name(&cnx->kobject, "cnx%.2d", rlp); | ||
850 | if (rc != 0) | ||
851 | return rc; | ||
852 | 848 | ||
853 | msgs = kcalloc(VETH_NUMBUFFERS, sizeof(struct veth_msg), GFP_KERNEL); | 849 | msgs = kcalloc(VETH_NUMBUFFERS, sizeof(struct veth_msg), GFP_KERNEL); |
854 | if (! msgs) { | 850 | if (! msgs) { |
@@ -1087,11 +1083,8 @@ static struct net_device * __init veth_probe_one(int vlan, | |||
1087 | return NULL; | 1083 | return NULL; |
1088 | } | 1084 | } |
1089 | 1085 | ||
1090 | kobject_init(&port->kobject); | 1086 | kobject_init(&port->kobject, &veth_port_ktype); |
1091 | port->kobject.parent = &dev->dev.kobj; | 1087 | if (0 != kobject_add(&port->kobject, &dev->dev.kobj, "veth_port")) |
1092 | port->kobject.ktype = &veth_port_ktype; | ||
1093 | kobject_set_name(&port->kobject, "veth_port"); | ||
1094 | if (0 != kobject_add(&port->kobject)) | ||
1095 | veth_error("Failed adding port for %s to sysfs.\n", dev->name); | 1088 | veth_error("Failed adding port for %s to sysfs.\n", dev->name); |
1096 | 1089 | ||
1097 | veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n", | 1090 | veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n", |
@@ -1711,9 +1704,9 @@ static int __init veth_module_init(void) | |||
1711 | continue; | 1704 | continue; |
1712 | 1705 | ||
1713 | kobj = &veth_cnx[i]->kobject; | 1706 | kobj = &veth_cnx[i]->kobject; |
1714 | kobj->parent = &veth_driver.driver.kobj; | ||
1715 | /* If the add failes, complain but otherwise continue */ | 1707 | /* If the add failes, complain but otherwise continue */ |
1716 | if (0 != kobject_add(kobj)) | 1708 | if (0 != driver_add_kobj(&veth_driver.driver, kobj, |
1709 | "cnx%.2d", veth_cnx[i]->remote_lp)) | ||
1717 | veth_error("cnx %d: Failed adding to sysfs.\n", i); | 1710 | veth_error("cnx %d: Failed adding to sysfs.\n", i); |
1718 | } | 1711 | } |
1719 | 1712 | ||
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index ff37bf437a99..1d706eae3052 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -395,8 +395,7 @@ static int __init cosa_init(void) | |||
395 | goto out_chrdev; | 395 | goto out_chrdev; |
396 | } | 396 | } |
397 | for (i=0; i<nr_cards; i++) { | 397 | for (i=0; i<nr_cards; i++) { |
398 | class_device_create(cosa_class, NULL, MKDEV(cosa_major, i), | 398 | device_create(cosa_class, NULL, MKDEV(cosa_major, i), "cosa%d", i); |
399 | NULL, "cosa%d", i); | ||
400 | } | 399 | } |
401 | err = 0; | 400 | err = 0; |
402 | goto out; | 401 | goto out; |
@@ -415,7 +414,7 @@ static void __exit cosa_exit(void) | |||
415 | printk(KERN_INFO "Unloading the cosa module\n"); | 414 | printk(KERN_INFO "Unloading the cosa module\n"); |
416 | 415 | ||
417 | for (i=0; i<nr_cards; i++) | 416 | for (i=0; i<nr_cards; i++) |
418 | class_device_destroy(cosa_class, MKDEV(cosa_major, i)); | 417 | device_destroy(cosa_class, MKDEV(cosa_major, i)); |
419 | class_destroy(cosa_class); | 418 | class_destroy(cosa_class); |
420 | for (cosa=cosa_cards; nr_cards--; cosa++) { | 419 | for (cosa=cosa_cards; nr_cards--; cosa++) { |
421 | /* Clean up the per-channel data */ | 420 | /* Clean up the per-channel data */ |