summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r--drivers/infiniband/core/device.c40
1 files changed, 6 insertions, 34 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 1174ab7da629..1b5f1ee0a557 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -361,34 +361,6 @@ static struct ib_device *__ib_device_get_by_name(const char *name)
return NULL;
}
-/**
- * ib_device_get_by_name - Find an IB device by name
- * @name: The name to look for
- * @driver_id: The driver ID that must match (RDMA_DRIVER_UNKNOWN matches all)
- *
- * Find and hold an ib_device by its name. The caller must call
- * ib_device_put() on the returned pointer.
- */
-struct ib_device *ib_device_get_by_name(const char *name,
- enum rdma_driver_id driver_id)
-{
- struct ib_device *device;
-
- down_read(&devices_rwsem);
- device = __ib_device_get_by_name(name);
- if (device && driver_id != RDMA_DRIVER_UNKNOWN &&
- device->ops.driver_id != driver_id)
- device = NULL;
-
- if (device) {
- if (!ib_device_try_get(device))
- device = NULL;
- }
- up_read(&devices_rwsem);
- return device;
-}
-EXPORT_SYMBOL(ib_device_get_by_name);
-
static int rename_compat_devs(struct ib_device *device)
{
struct ib_core_device *cdev;
@@ -839,9 +811,8 @@ static int alloc_port_data(struct ib_device *device)
* Therefore port_data is declared as a 1 based array with potential
* empty slots at the beginning.
*/
- pdata_rcu = kzalloc(struct_size(pdata_rcu, pdata,
- size_add(rdma_end_port(device), 1)),
- GFP_KERNEL);
+ pdata_rcu = kzalloc_flex(*pdata_rcu, pdata,
+ size_add(rdma_end_port(device), 1));
if (!pdata_rcu)
return -ENOMEM;
/*
@@ -986,7 +957,7 @@ static int add_one_compat_dev(struct ib_device *device,
if (ret)
goto done;
- cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
+ cdev = kzalloc_obj(*cdev);
if (!cdev) {
ret = -ENOMEM;
goto cdev_err;
@@ -2793,6 +2764,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
SET_DEVICE_OP(dev_ops, map_mr_sg);
SET_DEVICE_OP(dev_ops, map_mr_sg_pi);
SET_DEVICE_OP(dev_ops, mmap);
+ SET_DEVICE_OP(dev_ops, mmap_get_pfns);
SET_DEVICE_OP(dev_ops, mmap_free);
SET_DEVICE_OP(dev_ops, modify_ah);
SET_DEVICE_OP(dev_ops, modify_cq);
@@ -2803,6 +2775,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
SET_DEVICE_OP(dev_ops, modify_srq);
SET_DEVICE_OP(dev_ops, modify_wq);
SET_DEVICE_OP(dev_ops, peek_cq);
+ SET_DEVICE_OP(dev_ops, pgoff_to_mmap_entry);
SET_DEVICE_OP(dev_ops, pre_destroy_cq);
SET_DEVICE_OP(dev_ops, poll_cq);
SET_DEVICE_OP(dev_ops, port_groups);
@@ -2816,6 +2789,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
SET_DEVICE_OP(dev_ops, query_gid);
SET_DEVICE_OP(dev_ops, query_pkey);
SET_DEVICE_OP(dev_ops, query_port);
+ SET_DEVICE_OP(dev_ops, query_port_speed);
SET_DEVICE_OP(dev_ops, query_qp);
SET_DEVICE_OP(dev_ops, query_srq);
SET_DEVICE_OP(dev_ops, query_ucontext);
@@ -2875,7 +2849,6 @@ int ib_add_sub_device(struct ib_device *parent,
return ret;
}
-EXPORT_SYMBOL(ib_add_sub_device);
int ib_del_sub_device_and_put(struct ib_device *sub)
{
@@ -2896,7 +2869,6 @@ int ib_del_sub_device_and_put(struct ib_device *sub)
return 0;
}
-EXPORT_SYMBOL(ib_del_sub_device_and_put);
#ifdef CONFIG_INFINIBAND_VIRT_DMA
int ib_dma_virt_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents)