Skip to content

Commit

Permalink
Kobject: change drivers/net/ibmveth.c to use kobject_init_and_add
Browse files Browse the repository at this point in the history
Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Dave Larson <larson1@us.ibm.com>
Cc: Santiago Leon <santil@us.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent d48b335 commit 8dde2a9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/net/ibmveth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8dde2a9

Please sign in to comment.