[openib-general] [PATCH] [TRIVIAL] ib_mad.c: change device to port routine names where appropriate

Hal Rosenstock halr at voltaire.com
Fri Sep 10 12:26:51 PDT 2004


ib_mad.c: change device to port routine names where appropriate

Index: ib_mad.c
===================================================================
--- ib_mad.c	(revision 762)
+++ ib_mad.c	(working copy)
@@ -1025,7 +1025,7 @@
 	IB_MAD_DEVICE_LIST_UNLOCK();}
 
 /*
- * Start the device
+ * Start the device 
  */
 static int ib_mad_device_start(struct ib_mad_device_private *priv)
 {
@@ -1112,10 +1112,10 @@
 }
 
 /*
- * Open the device
+ * Open the port
  * Create the QP, PD, MR, and CQ if needed
  */
-static int ib_mad_device_open(struct ib_device *device, int port)
+static int ib_mad_port_open(struct ib_device *device, int port)
 {
 	int ret, cq_size, i;
 	u64 iova = 0;
@@ -1130,7 +1130,7 @@
 				     *head = (struct ib_mad_device_private *) &ib_mad_device_list;
 	IB_MAD_DEVICE_LIST_LOCK_VAR;
 
-	/* First, check if device already open at MAD layer */
+	/* First, check if port already open at MAD layer */
 	IB_MAD_DEVICE_LIST_LOCK();
 	list_for_each(entry, head) {
 		if (entry->device == device && entry->port == port) {
@@ -1140,7 +1140,7 @@
 	}
 	IB_MAD_DEVICE_LIST_UNLOCK();
 	if (priv) {
-		printk(KERN_DEBUG "Device already open\n");
+		printk(KERN_DEBUG "Port already open\n");
 		return 0;
 	}
 
@@ -1252,11 +1252,11 @@
 }
 
 /*
- * Close the device
- * If there are no classes using the device, free the device 
- * resources (CQ, MR, PD, QP) and remove the device info structure
+ * Close the port 
+ * If there are no classes using the port, free the port 
+ * resources (CQ, MR, PD, QP) and remove the port's info structure
  */
-static int ib_mad_device_close(struct ib_device *device, int port)
+static int ib_mad_port_close(struct ib_device *device, int port)
 {
 	struct ib_mad_device_private *entry, *priv = NULL,
 				     *head = (struct ib_mad_device_private *)&ib_mad_device_list;
@@ -1271,7 +1271,7 @@
 	}
 
 	if (priv == NULL) {
-		printk(KERN_ERR "Device not found\n");
+		printk(KERN_ERR "Port not found\n");
 		IB_MAD_DEVICE_LIST_UNLOCK();
 		return -ENODEV;
 	}
@@ -1310,7 +1310,7 @@
 		num_ports = device_attr.phys_port_cnt;
 	}
 	for (i = 0; i < num_ports; i++) {
-		ret = ib_mad_device_open(device, i);
+		ret = ib_mad_port_open(device, i);
 		if (ret) {
 			printk(KERN_ERR "Could not open device port %d\n", i);
 			goto error_device_open;
@@ -1321,7 +1321,7 @@
 
 error_device_open:
 	while (i > 0) {
-		ret2 = ib_mad_device_close(device, i);
+		ret2 = ib_mad_port_close(device, i);
 		if (ret2) {
 			printk(KERN_ERR "Could not close device port %d\n", i);
 		}
@@ -1346,7 +1346,7 @@
 	/* num_ports should also be based on device type! */
 	num_ports = device_attr.phys_port_cnt;
 	for (i = 0; i < num_ports; i++) {
-		ret2 = ib_mad_device_close(device, i);
+		ret2 = ib_mad_port_close(device, i);
 		if (ret2) {
 			printk(KERN_ERR "Could not close device port %d\n", i);
 			if (!ret)





More information about the general mailing list