init_rwsem(&port->mutex); INIT_LIST_HEAD(&port->file_list); 
static int ib_umad_init_port(struct ib_device *device, int port_num,			     struct ib_umad_port *port){	spin_lock(&port_lock);	port->dev_num = find_first_zero_bit(dev_map, IB_UMAD_MAX_PORTS);	if (port->dev_num >= IB_UMAD_MAX_PORTS) {		spin_unlock(&port_lock);		return -1;	}	set_bit(port->dev_num, dev_map);	spin_unlock(&port_lock);	port->ib_dev   = device;	port->port_num = port_num;	init_MUTEX(&port->sm_sem);	port->dev = cdev_alloc();	if (!port->dev)		return -1;	port->dev->owner = THIS_MODULE;	port->dev->ops   = &umad_fops;	kobject_set_name(&port->dev->kobj, "umad%d", port->dev_num);	if (cdev_add(port->dev, base_dev + port->dev_num, 1))		goto err_cdev;	port->class_dev = class_device_create(umad_class, NULL, port->dev->dev,					      device->dma_device,					      "umad%d", port->dev_num);	if (IS_ERR(port->class_dev))		goto err_cdev;	if (class_device_create_file(port->class_dev, &class_device_attr_ibdev))		goto err_class;	if (class_device_create_file(port->class_dev, &class_device_attr_port))		goto err_class;	port->sm_dev = cdev_alloc();	if (!port->sm_dev)		goto err_class;	port->sm_dev->owner = THIS_MODULE;	port->sm_dev->ops   = &umad_sm_fops;	kobject_set_name(&port->dev->kobj, "issm%d", port->dev_num);	if (cdev_add(port->sm_dev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))		goto err_sm_cdev;	port->sm_class_dev = class_device_create(umad_class, NULL, port->sm_dev->dev,						 device->dma_device,						 "issm%d", port->dev_num);	if (IS_ERR(port->sm_class_dev))		goto err_sm_cdev;	class_set_devdata(port->class_dev,    port);	class_set_devdata(port->sm_class_dev, port);	if (class_device_create_file(port->sm_class_dev, &class_device_attr_ibdev))		goto err_sm_class;	if (class_device_create_file(port->sm_class_dev, &class_device_attr_port))		goto err_sm_class;	spin_lock(&port_lock);	umad_port[port->dev_num] = port;	spin_unlock(&port_lock);	return 0;err_sm_class:	class_device_destroy(umad_class, port->sm_dev->dev);err_sm_cdev:	cdev_del(port->sm_dev);err_class:	class_device_destroy(umad_class, port->dev->dev);err_cdev:	cdev_del(port->dev);	clear_bit(port->dev_num, dev_map);	return -1;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/0c99cb6d5fe77872c5a32cff837c05f70158ce15/user_mad.c/clean/drivers/infiniband/core/user_mad.c