{
struct veth_lpar_connection *cnx;
struct veth_msg *msgs;
- int i, rc;
+ int i;
if ( (rlp == this_lp)
|| ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, 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_ng(&cnx->kobject, &veth_lpar_connection_ktype);
msgs = kcalloc(VETH_NUMBUFFERS, sizeof(struct veth_msg), GFP_KERNEL);
if (! msgs) {
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_ng(&port->kobject, &veth_port_ktype);
+ if (0 != kobject_add_ng(&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",
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 != kobject_add_ng(kobj, &veth_driver.driver.kobj,
+ "cnx%.2d", veth_cnx[i]->remote_lp))
veth_error("cnx %d: Failed adding to sysfs.\n", i);
}