aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/iseries_veth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/iseries_veth.c')
-rw-r--r--drivers/net/iseries_veth.c19
1 files changed, 6 insertions, 13 deletions
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