aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/sysfs.c
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2018-12-18 14:28:30 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-01-14 13:05:14 -0700
commitea4baf7f116a18382df331db2123d98bc1c3cd83 (patch)
treeeda84e63f296b43e6132b1924b9887617e639714 /drivers/infiniband/core/sysfs.c
parentRDMA: Clear CTX objects during their allocation (diff)
downloadlinux-dev-ea4baf7f116a18382df331db2123d98bc1c3cd83.tar.xz
linux-dev-ea4baf7f116a18382df331db2123d98bc1c3cd83.zip
RDMA: Rename port_callback to init_port
Most provider routines are callback routines which ib core invokes. _callback suffix doesn't convey information about when such callback is invoked. Therefore, rename port_callback to init_port. Additionally, store the init_port function pointer in ib_device_ops, so that it can be accessed in subsequent patches when binding rdma device to net namespace. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/sysfs.c')
-rw-r--r--drivers/infiniband/core/sysfs.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 80f68eb0ba5c..7a5679933df6 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -1015,9 +1015,7 @@ err_free_stats:
return;
}
-static int add_port(struct ib_device *device, int port_num,
- int (*port_callback)(struct ib_device *,
- u8, struct kobject *))
+static int add_port(struct ib_device *device, int port_num)
{
struct ib_port *p;
struct ib_port_attr attr;
@@ -1113,8 +1111,8 @@ static int add_port(struct ib_device *device, int port_num,
if (ret)
goto err_free_pkey;
- if (port_callback) {
- ret = port_callback(device, port_num, &p->kobj);
+ if (device->ops.init_port) {
+ ret = device->ops.init_port(device, port_num, &p->kobj);
if (ret)
goto err_remove_pkey;
}
@@ -1308,9 +1306,7 @@ static void free_port_list_attributes(struct ib_device *device)
kobject_put(device->ports_kobj);
}
-int ib_device_register_sysfs(struct ib_device *device,
- int (*port_callback)(struct ib_device *,
- u8, struct kobject *))
+int ib_device_register_sysfs(struct ib_device *device)
{
struct device *class_dev = &device->dev;
int ret;
@@ -1330,12 +1326,12 @@ int ib_device_register_sysfs(struct ib_device *device,
}
if (rdma_cap_ib_switch(device)) {
- ret = add_port(device, 0, port_callback);
+ ret = add_port(device, 0);
if (ret)
goto err_put;
} else {
for (i = 1; i <= device->phys_port_cnt; ++i) {
- ret = add_port(device, i, port_callback);
+ ret = add_port(device, i);
if (ret)
goto err_put;
}