aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/uverbs_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index acae9ed05728..8c594cde8a1d 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -731,6 +731,7 @@ static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
731static void ib_uverbs_add_one(struct ib_device *device) 731static void ib_uverbs_add_one(struct ib_device *device)
732{ 732{
733 int devnum; 733 int devnum;
734 dev_t base;
734 struct ib_uverbs_device *uverbs_dev; 735 struct ib_uverbs_device *uverbs_dev;
735 736
736 if (!device->alloc_ucontext) 737 if (!device->alloc_ucontext)
@@ -750,6 +751,7 @@ static void ib_uverbs_add_one(struct ib_device *device)
750 goto err; 751 goto err;
751 } 752 }
752 uverbs_dev->devnum = devnum; 753 uverbs_dev->devnum = devnum;
754 base = devnum + IB_UVERBS_BASE_DEV;
753 set_bit(devnum, dev_map); 755 set_bit(devnum, dev_map);
754 spin_unlock(&map_lock); 756 spin_unlock(&map_lock);
755 757
@@ -760,7 +762,7 @@ static void ib_uverbs_add_one(struct ib_device *device)
760 uverbs_dev->cdev.owner = THIS_MODULE; 762 uverbs_dev->cdev.owner = THIS_MODULE;
761 uverbs_dev->cdev.ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops; 763 uverbs_dev->cdev.ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops;
762 kobject_set_name(&uverbs_dev->cdev.kobj, "uverbs%d", uverbs_dev->devnum); 764 kobject_set_name(&uverbs_dev->cdev.kobj, "uverbs%d", uverbs_dev->devnum);
763 if (cdev_add(&uverbs_dev->cdev, IB_UVERBS_BASE_DEV + devnum, 1)) 765 if (cdev_add(&uverbs_dev->cdev, base, 1))
764 goto err_cdev; 766 goto err_cdev;
765 767
766 uverbs_dev->dev = device_create(uverbs_class, device->dma_device, 768 uverbs_dev->dev = device_create(uverbs_class, device->dma_device,