aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:34:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:35:13 -0500
commitdf8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e (patch)
treebc3799a43e8b94fa84b32e37b1c124d5e4868f50 /drivers/net
parent556a169dab38b5100df6f4a45b655dddd3db94c1 (diff)
parent4a3ad20ccd8f4d2a0535cf98fa83f7b561ba59a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
This can be broken down into these major areas: - Documentation updates (language translations and fixes, as well as kobject and kset documenatation updates.) - major kset/kobject/ktype rework and fixes. This cleans up the kset and kobject and ktype relationship and architecture, making sense of things now, and good documenation and samples are provided for others to use. Also the attributes for kobjects are much easier to handle now. This cleaned up a LOT of code all through the kernel, making kobjects easier to use if you want to. - struct bus_type has been reworked to now handle the lifetime rules properly, as the kobject is properly dynamic. - struct driver has also been reworked, and now the lifetime issues are resolved. - the block subsystem has been converted to use struct device now, and not "raw" kobjects. This patch has been in the -mm tree for over a year now, and finally all the issues are worked out with it. Older distros now properly work with new kernels, and no userspace updates are needed at all. - nozomi driver is added. This has also been in -mm for a long time, and many people have asked for it to go in. It is now in good enough shape to do so. - lots of class_device conversions to use struct device instead. The tree is almost all cleaned up now, only SCSI and IB is the remaining code to fix up... * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits) Driver core: coding style fixes Kobject: fix coding style issues in kobject c files Kobject: fix coding style issues in kobject.h Driver core: fix coding style issues in device.h spi: use class iteration api scsi: use class iteration api rtc: use class iteration api power supply : use class iteration api ieee1394: use class iteration api Driver Core: add class iteration api Driver core: Cleanup get_device_parent() in device_add() and device_move() UIO: constify function pointer tables Driver Core: constify the name passed to platform_device_register_simple driver core: fix build with SYSFS=n sysfs: make SYSFS_DEPRECATED depend on SYSFS Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init kobject: add sample code for how to use ksets/ktypes/kobjects kobject: add sample code for how to use kobjects in a simple manner. kobject: update the kobject/kset documentation kobject: remove old, outdated documentation. ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ibmveth.c12
-rw-r--r--drivers/net/iseries_veth.c19
-rw-r--r--drivers/net/wan/cosa.c5
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 */