summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 08:34:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 08:35:13 -0800
commitdf8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e (patch)
treebc3799a43e8b94fa84b32e37b1c124d5e4868f50 /drivers/net
parent556a169dab38b5100df6f4a45b655dddd3db94c1 (diff)
parent4a3ad20ccd8f4d2a0535cf98fa83f7b561ba59a9 (diff)
downloadop-kernel-dev-df8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e.zip
op-kernel-dev-df8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e.tar.gz
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 7d7758f..57772be 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_
for(i = 0; i<IbmVethNumBufferPools; i++) {
struct kobject *kobj = &adapter->rx_buff_pool[i].kobj;
+ int error;
+
ibmveth_init_buffer_pool(&adapter->rx_buff_pool[i], i,
pool_count[i], pool_size[i],
pool_active[i]);
- kobj->parent = &dev->dev.kobj;
- kobject_set_name(kobj, "pool%d", i);
- kobj->ktype = &ktype_veth_pool;
- kobject_register(kobj);
+ error = kobject_init_and_add(kobj, &ktype_veth_pool,
+ &dev->dev.kobj, "pool%d", i);
+ if (!error)
+ kobject_uevent(kobj, KOBJ_ADD);
}
ibmveth_debug_printk("adapter @ 0x%p\n", adapter);
@@ -1234,7 +1236,7 @@ static int __devexit ibmveth_remove(struct vio_dev *dev)
int i;
for(i = 0; i<IbmVethNumBufferPools; i++)
- kobject_unregister(&adapter->rx_buff_pool[i].kobj);
+ kobject_put(&adapter->rx_buff_pool[i].kobj);
unregister_netdev(netdev);
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 97bd9dc..419861c 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -815,7 +815,7 @@ static int veth_init_connection(u8 rlp)
{
struct veth_lpar_connection *cnx;
struct veth_msg *msgs;
- int i, rc;
+ int i;
if ( (rlp == this_lp)
|| ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) )
@@ -844,11 +844,7 @@ static int veth_init_connection(u8 rlp)
/* This gets us 1 reference, which is held on behalf of the driver
* infrastructure. It's released at module unload. */
- kobject_init(&cnx->kobject);
- cnx->kobject.ktype = &veth_lpar_connection_ktype;
- rc = kobject_set_name(&cnx->kobject, "cnx%.2d", rlp);
- if (rc != 0)
- return rc;
+ kobject_init(&cnx->kobject, &veth_lpar_connection_ktype);
msgs = kcalloc(VETH_NUMBUFFERS, sizeof(struct veth_msg), GFP_KERNEL);
if (! msgs) {
@@ -1087,11 +1083,8 @@ static struct net_device * __init veth_probe_one(int vlan,
return NULL;
}
- kobject_init(&port->kobject);
- port->kobject.parent = &dev->dev.kobj;
- port->kobject.ktype = &veth_port_ktype;
- kobject_set_name(&port->kobject, "veth_port");
- if (0 != kobject_add(&port->kobject))
+ kobject_init(&port->kobject, &veth_port_ktype);
+ if (0 != kobject_add(&port->kobject, &dev->dev.kobj, "veth_port"))
veth_error("Failed adding port for %s to sysfs.\n", dev->name);
veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n",
@@ -1711,9 +1704,9 @@ static int __init veth_module_init(void)
continue;
kobj = &veth_cnx[i]->kobject;
- kobj->parent = &veth_driver.driver.kobj;
/* If the add failes, complain but otherwise continue */
- if (0 != kobject_add(kobj))
+ if (0 != driver_add_kobj(&veth_driver.driver, kobj,
+ "cnx%.2d", veth_cnx[i]->remote_lp))
veth_error("cnx %d: Failed adding to sysfs.\n", i);
}
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index ff37bf4..1d706ea 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -395,8 +395,7 @@ static int __init cosa_init(void)
goto out_chrdev;
}
for (i=0; i<nr_cards; i++) {
- class_device_create(cosa_class, NULL, MKDEV(cosa_major, i),
- NULL, "cosa%d", i);
+ device_create(cosa_class, NULL, MKDEV(cosa_major, i), "cosa%d", i);
}
err = 0;
goto out;
@@ -415,7 +414,7 @@ static void __exit cosa_exit(void)
printk(KERN_INFO "Unloading the cosa module\n");
for (i=0; i<nr_cards; i++)
- class_device_destroy(cosa_class, MKDEV(cosa_major, i));
+ device_destroy(cosa_class, MKDEV(cosa_major, i));
class_destroy(cosa_class);
for (cosa=cosa_cards; nr_cards--; cosa++) {
/* Clean up the per-channel data */
OpenPOWER on IntegriCloud