[ewg] [PATCH OFED-1.5] qlgc_vnic and srpt: convert references of bus_id to dev_name

Jon Mason jon at opengridcomputing.com
Thu May 7 13:21:45 PDT 2009


bus_id has been removed from the device struct in the 2.6.30 kernel.
Reference directly to the value have been discouraged in previously
kernel releases and it has been recommended to using dev_name in its
place (which has been in existence since 2.6.25).  dev_set_name performs
the exact same functionality as the snprintfs in this patch, and the
modification removes the reference to bus_id (as it references dev_name
under the covers).

This fixes a build break of OFED 1.5 on the 2.6.30 kernel (but these
drivers have only been compile tested).

Signed-Off-By: Jon Mason <jon at opengridcomputing.com>
---

diff --git a/drivers/infiniband/ulp/qlgc_vnic/vnic_ib.c b/drivers/infiniband/ulp/qlgc_vnic/vnic_ib.c
index 451dc4e..9bf7bcf 100644
--- a/drivers/infiniband/ulp/qlgc_vnic/vnic_ib.c
+++ b/drivers/infiniband/ulp/qlgc_vnic/vnic_ib.c
@@ -91,8 +91,7 @@ int vnic_ib_init(void)
 
 	interface_dev.dev.class = &vnic_class;
 	interface_dev.dev.release = vnic_release_dev;
-	snprintf(interface_dev.dev.bus_id,
-		 BUS_ID_SIZE, "interfaces");
+	dev_set_name(&interface_dev.dev, "interfaces");
 	init_completion(&interface_dev.released);
 	ret = device_register(&interface_dev.dev);
 	if (ret) {
@@ -155,8 +154,8 @@ static struct vnic_ib_port *vnic_add_port(struct vnic_ib_device *device,
 	port->pdev_info.dev.class = &vnic_class;
 	port->pdev_info.dev.parent = NULL;
 	port->pdev_info.dev.release = vnic_release_dev;
-	snprintf(port->pdev_info.dev.bus_id, BUS_ID_SIZE,
-		 "vnic-%s-%d", device->dev->name, port_num);
+	dev_set_name(&port->pdev_info.dev, "vnic-%s-%d",
+		device->dev->name, port_num);
 
 	if (device_register(&port->pdev_info.dev))
 		goto free_port;
diff --git a/drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c b/drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c
index 0ba1583..f3a35c4 100644
--- a/drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c
+++ b/drivers/infiniband/ulp/qlgc_vnic/vnic_sys.c
@@ -518,8 +518,7 @@ static struct vnic *create_vnic(struct path_param *param)
 	vnic->dev_info.dev.class = NULL;
 	vnic->dev_info.dev.parent = &interface_dev.dev;
 	vnic->dev_info.dev.release = vnic_release_dev;
-	snprintf(vnic->dev_info.dev.bus_id, BUS_ID_SIZE,
-		 vnic_config->name);
+	dev_set_name(&vnic->dev_info.dev, vnic_config->name);
 
 	if (device_register(&vnic->dev_info.dev)) {
 		SYS_ERROR("create_vnic: error in registering"
@@ -898,7 +897,7 @@ static int setup_path_class_files(struct netpath *path, char *name)
 	path->dev_info.dev.class = NULL;
 	path->dev_info.dev.parent = &path->parent->dev_info.dev;
 	path->dev_info.dev.release = vnic_release_dev;
-	snprintf(path->dev_info.dev.bus_id, BUS_ID_SIZE, name);
+	dev_set_name(&path->dev_info.dev, name);
 
 	if (device_register(&path->dev_info.dev)) {
 		SYS_ERROR("error in registering path class dev\n");
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 4e40b67..ec95b29 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -2364,7 +2364,7 @@ static void srpt_add_one(struct ib_device *device)
 
 	sdev->dev.class = &srpt_class;
 	sdev->dev.parent = device->dma_device;
-	snprintf(sdev->dev.bus_id, BUS_ID_SIZE, "srpt-%s", device->name);
+	dev_set_name(&sdev->dev, "srpt-%s", device->name);
 
 	if (device_register(&sdev->dev))
 		goto free_dev;



More information about the ewg mailing list