 uverbs_dev->class_dev.class = &uverbs_class; uverbs_dev->class_dev.dev   = device->dma_device; uverbs_dev->class_dev.devt  = uverbs_dev->dev.dev; snprintf(uverbs_dev->class_dev.class_id, BUS_ID_SIZE, "uverbs%d", uverbs_dev->devnum); if (class_device_register(&uverbs_dev->class_dev)) 
uverbs_dev->dev->owner = THIS_MODULE; uverbs_dev->dev->ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops; kobject_set_name(&uverbs_dev->dev->kobj, "uverbs%d", uverbs_dev->devnum); if (cdev_add(uverbs_dev->dev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1)) 
static void ib_uverbs_add_one(struct ib_device *device){	struct ib_uverbs_device *uverbs_dev;	if (!device->alloc_ucontext)		return;	uverbs_dev = kmalloc(sizeof *uverbs_dev, GFP_KERNEL);	if (!uverbs_dev)		return;	memset(uverbs_dev, 0, sizeof *uverbs_dev);	spin_lock(&map_lock);	uverbs_dev->devnum = find_first_zero_bit(dev_map, IB_UVERBS_MAX_DEVICES);	if (uverbs_dev->devnum >= IB_UVERBS_MAX_DEVICES) {		spin_unlock(&map_lock);		goto err;	}	set_bit(uverbs_dev->devnum, dev_map);	spin_unlock(&map_lock);	uverbs_dev->ib_dev           = device;	uverbs_dev->num_comp_vectors = 1;	if (device->mmap)		cdev_init(&uverbs_dev->dev, &uverbs_mmap_fops);	else		cdev_init(&uverbs_dev->dev, &uverbs_fops);	uverbs_dev->dev.owner = THIS_MODULE;	kobject_set_name(&uverbs_dev->dev.kobj, "uverbs%d", uverbs_dev->devnum);	if (cdev_add(&uverbs_dev->dev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1))		goto err;	uverbs_dev->class_dev.class = &uverbs_class;	uverbs_dev->class_dev.dev   = device->dma_device;	uverbs_dev->class_dev.devt  = uverbs_dev->dev.dev;	snprintf(uverbs_dev->class_dev.class_id, BUS_ID_SIZE, "uverbs%d", uverbs_dev->devnum);	if (class_device_register(&uverbs_dev->class_dev))		goto err_cdev;	if (class_device_create_file(&uverbs_dev->class_dev, &class_device_attr_ibdev))		goto err_class;	if (class_device_create_file(&uverbs_dev->class_dev, &class_device_attr_abi_version))		goto err_class;	ib_set_client_data(device, &uverbs_client, uverbs_dev);	return;err_class:	class_device_unregister(&uverbs_dev->class_dev);err_cdev:	cdev_del(&uverbs_dev->dev);	clear_bit(uverbs_dev->devnum, dev_map);err:	kfree(uverbs_dev);	return;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/70a30e16a8a9d22396a4d1e96af86e43594df584/uverbs_main.c/clean/drivers/infiniband/core/uverbs_main.c