sysfs.c (f681967ae7d5d3d28e67f754f069bf6cdc87a0d2) sysfs.c (b6eb7011f561a29d91f290e02a8dabee8169da9d)
1/*
2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
4 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file

--- 1060 unchanged lines hidden (view full) ---

1069 return -ENOMEM;
1070
1071 p->ibdev = device;
1072 p->port_num = port_num;
1073
1074 ret = kobject_init_and_add(&p->kobj, &port_type,
1075 coredev->ports_kobj,
1076 "%d", port_num);
1/*
2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved.
4 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file

--- 1060 unchanged lines hidden (view full) ---

1069 return -ENOMEM;
1070
1071 p->ibdev = device;
1072 p->port_num = port_num;
1073
1074 ret = kobject_init_and_add(&p->kobj, &port_type,
1075 coredev->ports_kobj,
1076 "%d", port_num);
1077 if (ret) {
1077 if (ret)
1078 goto err_put;
1078 goto err_put;
1079 }
1080
1081 p->gid_attr_group = kzalloc(sizeof(*p->gid_attr_group), GFP_KERNEL);
1082 if (!p->gid_attr_group) {
1083 ret = -ENOMEM;
1084 goto err_put;
1085 }
1086
1087 p->gid_attr_group->port = p;
1088 ret = kobject_init_and_add(&p->gid_attr_group->kobj, &gid_attr_type,
1089 &p->kobj, "gid_attrs");
1079
1080 p->gid_attr_group = kzalloc(sizeof(*p->gid_attr_group), GFP_KERNEL);
1081 if (!p->gid_attr_group) {
1082 ret = -ENOMEM;
1083 goto err_put;
1084 }
1085
1086 p->gid_attr_group->port = p;
1087 ret = kobject_init_and_add(&p->gid_attr_group->kobj, &gid_attr_type,
1088 &p->kobj, "gid_attrs");
1090 if (ret) {
1089 if (ret)
1091 goto err_put_gid_attrs;
1090 goto err_put_gid_attrs;
1092 }
1093
1094 if (device->ops.process_mad && is_full_dev) {
1095 p->pma_table = get_counter_table(device, port_num);
1096 ret = sysfs_create_group(&p->kobj, p->pma_table);
1097 if (ret)
1098 goto err_put_gid_attrs;
1099 }
1100

--- 372 unchanged lines hidden ---
1091
1092 if (device->ops.process_mad && is_full_dev) {
1093 p->pma_table = get_counter_table(device, port_num);
1094 ret = sysfs_create_group(&p->kobj, p->pma_table);
1095 if (ret)
1096 goto err_put_gid_attrs;
1097 }
1098

--- 372 unchanged lines hidden ---