aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-07-14 17:29:34 -0400
committerJonathan Corbet <corbet@lwn.net>2008-07-14 17:29:34 -0400
commit2fceef397f9880b212a74c418290ce69e7ac00eb (patch)
treed9cc09ab992825ef7fede4a688103503e3caf655 /drivers/infiniband/core
parentfeae1ef116ed381625d3731c5ae4f4ebcb3fa302 (diff)
parentbce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff)
Merge commit 'v2.6.26' into bkl-removal
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/mad.c4
-rw-r--r--drivers/infiniband/core/umem.c2
-rw-r--r--drivers/infiniband/core/user_mad.c14
-rw-r--r--drivers/infiniband/core/uverbs_main.c13
4 files changed, 17 insertions, 16 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index fbe16d5250a4..1adf2efd3cb3 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -747,7 +747,9 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
747 break; 747 break;
748 case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED: 748 case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED:
749 kmem_cache_free(ib_mad_cache, mad_priv); 749 kmem_cache_free(ib_mad_cache, mad_priv);
750 break; 750 kfree(local);
751 ret = 1;
752 goto out;
751 case IB_MAD_RESULT_SUCCESS: 753 case IB_MAD_RESULT_SUCCESS:
752 /* Treat like an incoming receive MAD */ 754 /* Treat like an incoming receive MAD */
753 port_priv = ib_get_mad_port(mad_agent_priv->agent.device, 755 port_priv = ib_get_mad_port(mad_agent_priv->agent.device,
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index fe78f7d25099..a1768dbb0720 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -150,7 +150,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
150 ret = 0; 150 ret = 0;
151 while (npages) { 151 while (npages) {
152 ret = get_user_pages(current, current->mm, cur_base, 152 ret = get_user_pages(current, current->mm, cur_base,
153 min_t(int, npages, 153 min_t(unsigned long, npages,
154 PAGE_SIZE / sizeof (struct page *)), 154 PAGE_SIZE / sizeof (struct page *)),
155 1, !umem->writable, page_list, vma_list); 155 1, !umem->writable, page_list, vma_list);
156 156
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index ef6dd825fee9..208c7f34323c 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -1018,8 +1018,9 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
1018 if (cdev_add(port->cdev, base_dev + port->dev_num, 1)) 1018 if (cdev_add(port->cdev, base_dev + port->dev_num, 1))
1019 goto err_cdev; 1019 goto err_cdev;
1020 1020
1021 port->dev = device_create(umad_class, device->dma_device, 1021 port->dev = device_create_drvdata(umad_class, device->dma_device,
1022 port->cdev->dev, "umad%d", port->dev_num); 1022 port->cdev->dev, port,
1023 "umad%d", port->dev_num);
1023 if (IS_ERR(port->dev)) 1024 if (IS_ERR(port->dev))
1024 goto err_cdev; 1025 goto err_cdev;
1025 1026
@@ -1037,15 +1038,12 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
1037 if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1)) 1038 if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
1038 goto err_sm_cdev; 1039 goto err_sm_cdev;
1039 1040
1040 port->sm_dev = device_create(umad_class, device->dma_device, 1041 port->sm_dev = device_create_drvdata(umad_class, device->dma_device,
1041 port->sm_cdev->dev, 1042 port->sm_cdev->dev, port,
1042 "issm%d", port->dev_num); 1043 "issm%d", port->dev_num);
1043 if (IS_ERR(port->sm_dev)) 1044 if (IS_ERR(port->sm_dev))
1044 goto err_sm_cdev; 1045 goto err_sm_cdev;
1045 1046
1046 dev_set_drvdata(port->dev, port);
1047 dev_set_drvdata(port->sm_dev, port);
1048
1049 if (device_create_file(port->sm_dev, &dev_attr_ibdev)) 1047 if (device_create_file(port->sm_dev, &dev_attr_ibdev))
1050 goto err_sm_dev; 1048 goto err_sm_dev;
1051 if (device_create_file(port->sm_dev, &dev_attr_port)) 1049 if (device_create_file(port->sm_dev, &dev_attr_port))
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index fdfcf7910d9a..0f34858e31e7 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -423,7 +423,7 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
423 unsigned long flags; 423 unsigned long flags;
424 424
425 spin_lock_irqsave(&file->async_file->lock, flags); 425 spin_lock_irqsave(&file->async_file->lock, flags);
426 if (!file->async_file->is_closed) { 426 if (file->async_file->is_closed) {
427 spin_unlock_irqrestore(&file->async_file->lock, flags); 427 spin_unlock_irqrestore(&file->async_file->lock, flags);
428 return; 428 return;
429 } 429 }
@@ -766,14 +766,15 @@ static void ib_uverbs_add_one(struct ib_device *device)
766 if (cdev_add(uverbs_dev->cdev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1)) 766 if (cdev_add(uverbs_dev->cdev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1))
767 goto err_cdev; 767 goto err_cdev;
768 768
769 uverbs_dev->dev = device_create(uverbs_class, device->dma_device, 769 uverbs_dev->dev = device_create_drvdata(uverbs_class,
770 uverbs_dev->cdev->dev, 770 device->dma_device,
771 "uverbs%d", uverbs_dev->devnum); 771 uverbs_dev->cdev->dev,
772 uverbs_dev,
773 "uverbs%d",
774 uverbs_dev->devnum);
772 if (IS_ERR(uverbs_dev->dev)) 775 if (IS_ERR(uverbs_dev->dev))
773 goto err_cdev; 776 goto err_cdev;
774 777
775 dev_set_drvdata(uverbs_dev->dev, uverbs_dev);
776
777 if (device_create_file(uverbs_dev->dev, &dev_attr_ibdev)) 778 if (device_create_file(uverbs_dev->dev, &dev_attr_ibdev))
778 goto err_class; 779 goto err_class;
779 if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version)) 780 if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version))