Lines Matching refs:ret

155 	ssize_t ret;  in state_show()  local
166 ret = ib_query_port(p->ibdev, p->port_num, &attr); in state_show()
167 if (ret) in state_show()
168 return ret; in state_show()
179 ssize_t ret; in lid_show() local
181 ret = ib_query_port(p->ibdev, p->port_num, &attr); in lid_show()
182 if (ret) in lid_show()
183 return ret; in lid_show()
193 ssize_t ret; in lid_mask_count_show() local
195 ret = ib_query_port(p->ibdev, p->port_num, &attr); in lid_mask_count_show()
196 if (ret) in lid_mask_count_show()
197 return ret; in lid_mask_count_show()
206 ssize_t ret; in sm_lid_show() local
208 ret = ib_query_port(p->ibdev, p->port_num, &attr); in sm_lid_show()
209 if (ret) in sm_lid_show()
210 return ret; in sm_lid_show()
219 ssize_t ret; in sm_sl_show() local
221 ret = ib_query_port(p->ibdev, p->port_num, &attr); in sm_sl_show()
222 if (ret) in sm_sl_show()
223 return ret; in sm_sl_show()
232 ssize_t ret; in cap_mask_show() local
234 ret = ib_query_port(p->ibdev, p->port_num, &attr); in cap_mask_show()
235 if (ret) in cap_mask_show()
236 return ret; in cap_mask_show()
247 ssize_t ret; in rate_show() local
249 ret = ib_query_port(p->ibdev, p->port_num, &attr); in rate_show()
250 if (ret) in rate_show()
251 return ret; in rate_show()
321 ssize_t ret; in phys_state_show() local
323 ret = ib_query_port(p->ibdev, p->port_num, &attr); in phys_state_show()
324 if (ret) in phys_state_show()
325 return ret; in phys_state_show()
390 ssize_t ret; in _show_port_gid_attr() local
392 ret = ib_query_gid(p->ibdev, p->port_num, tab_attr->index, &gid, in _show_port_gid_attr()
394 if (ret) in _show_port_gid_attr()
397 ret = print(&gid_attr, buf); in _show_port_gid_attr()
402 return ret; in _show_port_gid_attr()
411 ssize_t ret; in show_port_gid() local
413 ret = ib_query_gid(p->ibdev, p->port_num, tab_attr->index, &gid, NULL); in show_port_gid()
414 if (ret) in show_port_gid()
415 return ret; in show_port_gid()
439 ssize_t ret; in show_port_pkey() local
441 ret = ib_query_pkey(p->ibdev, p->port_num, tab_attr->index, &pkey); in show_port_pkey()
442 if (ret) in show_port_pkey()
443 return ret; in show_port_pkey()
473 ssize_t ret; in get_perf_mad() local
481 ret = -ENOMEM; in get_perf_mad()
501 ret = -EINVAL; in get_perf_mad()
505 ret = size; in get_perf_mad()
509 return ret; in get_perf_mad()
519 ssize_t ret; in show_pma_counter() local
522 ret = get_perf_mad(p->ibdev, p->port_num, tab_attr->attr_id, &data, in show_pma_counter()
524 if (ret < 0) in show_pma_counter()
525 return ret; in show_pma_counter()
529 ret = sprintf(buf, "%u\n", (*data >> in show_pma_counter()
533 ret = sprintf(buf, "%u\n", *data); in show_pma_counter()
536 ret = sprintf(buf, "%u\n", in show_pma_counter()
540 ret = sprintf(buf, "%u\n", in show_pma_counter()
544 ret = sprintf(buf, "%llu\n", in show_pma_counter()
549 ret = 0; in show_pma_counter()
552 return ret; in show_pma_counter()
795 int ret; in update_hw_stats() local
799 ret = dev->get_hw_stats(dev, stats, port_num, index); in update_hw_stats()
800 if (ret < 0) in update_hw_stats()
801 return ret; in update_hw_stats()
802 if (ret == stats->num_counters) in update_hw_stats()
820 int ret; in show_hw_stats() local
833 ret = update_hw_stats(dev, stats, hsa->port_num, hsa->index); in show_hw_stats()
834 if (ret) in show_hw_stats()
836 ret = print_hw_stat(stats, hsa->index, buf); in show_hw_stats()
840 return ret; in show_hw_stats()
878 int ret; in set_stats_lifespan() local
880 ret = kstrtoint(buf, 10, &msecs); in set_stats_lifespan()
881 if (ret) in set_stats_lifespan()
882 return ret; in set_stats_lifespan()
957 int i, ret; in setup_hw_stats() local
977 ret = device->get_hw_stats(device, stats, port_num, in setup_hw_stats()
979 if (ret != stats->num_counters) in setup_hw_stats()
1002 ret = sysfs_create_group(kobj, hsag); in setup_hw_stats()
1003 if (ret) in setup_hw_stats()
1009 ret = sysfs_create_group(kobj, hsag); in setup_hw_stats()
1010 if (ret) in setup_hw_stats()
1035 int ret; in add_port() local
1037 ret = ib_query_port(device, port_num, &attr); in add_port()
1038 if (ret) in add_port()
1039 return ret; in add_port()
1048 ret = kobject_init_and_add(&p->kobj, &port_type, in add_port()
1051 if (ret) { in add_port()
1053 return ret; in add_port()
1058 ret = -ENOMEM; in add_port()
1063 ret = kobject_init_and_add(&p->gid_attr_group->kobj, &gid_attr_type, in add_port()
1065 if (ret) { in add_port()
1072 ret = sysfs_create_group(&p->kobj, p->pma_table); in add_port()
1073 if (ret) in add_port()
1080 ret = -ENOMEM; in add_port()
1084 ret = sysfs_create_group(&p->kobj, &p->gid_group); in add_port()
1085 if (ret) in add_port()
1092 ret = -ENOMEM; in add_port()
1096 ret = sysfs_create_group(&p->gid_attr_group->kobj, in add_port()
1098 if (ret) in add_port()
1105 ret = -ENOMEM; in add_port()
1109 ret = sysfs_create_group(&p->gid_attr_group->kobj, in add_port()
1111 if (ret) in add_port()
1118 ret = -ENOMEM; in add_port()
1122 ret = sysfs_create_group(&p->kobj, &p->pkey_group); in add_port()
1123 if (ret) in add_port()
1127 ret = port_callback(device, port_num, &p->kobj); in add_port()
1128 if (ret) in add_port()
1195 return ret; in add_port()
1252 int ret; in set_node_desc() local
1258 ret = ib_modify_device(dev, IB_DEVICE_MODIFY_NODE_DESC, &desc); in set_node_desc()
1259 if (ret) in set_node_desc()
1260 return ret; in set_node_desc()
1321 int ret; in ib_device_register_sysfs() local
1325 ret = dev_set_name(class_dev, "%s", device->name); in ib_device_register_sysfs()
1326 if (ret) in ib_device_register_sysfs()
1327 return ret; in ib_device_register_sysfs()
1329 ret = device_add(class_dev); in ib_device_register_sysfs()
1330 if (ret) in ib_device_register_sysfs()
1334 ret = device_create_file(class_dev, ib_class_attributes[i]); in ib_device_register_sysfs()
1335 if (ret) in ib_device_register_sysfs()
1342 ret = -ENOMEM; in ib_device_register_sysfs()
1347 ret = add_port(device, 0, port_callback); in ib_device_register_sysfs()
1348 if (ret) in ib_device_register_sysfs()
1352 ret = add_port(device, i, port_callback); in ib_device_register_sysfs()
1353 if (ret) in ib_device_register_sysfs()
1370 return ret; in ib_device_register_sysfs()
1408 int ret; in ib_port_register_module_stat() local
1416 ret = kobject_init_and_add(kobj, ktype, &port->kobj, "%s", in ib_port_register_module_stat()
1418 if (ret) { in ib_port_register_module_stat()
1420 return ret; in ib_port_register_module_stat()