aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2009-09-05 23:24:24 -0400
committerRoland Dreier <rolandd@cisco.com>2009-09-05 23:24:24 -0400
commitf1aa78b26e8dabc2956be94a93c40c6cc08eb4a3 (patch)
tree16a824455bdc6533996c03784f7a45d6722a41e5
parent181c74e87eb93df447a759af93cf0a279875ea7d (diff)
IB: Use printk_once() for driver versions
Replace open-coded reimplementations with printk_once(). Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch.c4
-rw-r--r--drivers/infiniband/hw/mlx4/main.c6
-rw-r--r--drivers/infiniband/hw/mthca/mthca_main.c6
3 files changed, 3 insertions, 13 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch.c b/drivers/infiniband/hw/cxgb3/iwch.c
index 26fc0a4eaa74..9cc99df3d614 100644
--- a/drivers/infiniband/hw/cxgb3/iwch.c
+++ b/drivers/infiniband/hw/cxgb3/iwch.c
@@ -105,11 +105,9 @@ static void rnic_init(struct iwch_dev *rnicp)
105static void open_rnic_dev(struct t3cdev *tdev) 105static void open_rnic_dev(struct t3cdev *tdev)
106{ 106{
107 struct iwch_dev *rnicp; 107 struct iwch_dev *rnicp;
108 static int vers_printed;
109 108
110 PDBG("%s t3cdev %p\n", __func__, tdev); 109 PDBG("%s t3cdev %p\n", __func__, tdev);
111 if (!vers_printed++) 110 printk_once(KERN_INFO MOD "Chelsio T3 RDMA Driver - version %s\n",
112 printk(KERN_INFO MOD "Chelsio T3 RDMA Driver - version %s\n",
113 DRV_VERSION); 111 DRV_VERSION);
114 rnicp = (struct iwch_dev *)ib_alloc_device(sizeof(*rnicp)); 112 rnicp = (struct iwch_dev *)ib_alloc_device(sizeof(*rnicp));
115 if (!rnicp) { 113 if (!rnicp) {
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index ae3d7590346e..0b2f77a98e2c 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -540,15 +540,11 @@ static struct device_attribute *mlx4_class_attributes[] = {
540 540
541static void *mlx4_ib_add(struct mlx4_dev *dev) 541static void *mlx4_ib_add(struct mlx4_dev *dev)
542{ 542{
543 static int mlx4_ib_version_printed;
544 struct mlx4_ib_dev *ibdev; 543 struct mlx4_ib_dev *ibdev;
545 int num_ports = 0; 544 int num_ports = 0;
546 int i; 545 int i;
547 546
548 if (!mlx4_ib_version_printed) { 547 printk_once(KERN_INFO "%s", mlx4_ib_version);
549 printk(KERN_INFO "%s", mlx4_ib_version);
550 ++mlx4_ib_version_printed;
551 }
552 548
553 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB) 549 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
554 num_ports++; 550 num_ports++;
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index 13da9f1d24c0..2e4e04303786 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -1215,15 +1215,11 @@ int __mthca_restart_one(struct pci_dev *pdev)
1215static int __devinit mthca_init_one(struct pci_dev *pdev, 1215static int __devinit mthca_init_one(struct pci_dev *pdev,
1216 const struct pci_device_id *id) 1216 const struct pci_device_id *id)
1217{ 1217{
1218 static int mthca_version_printed = 0;
1219 int ret; 1218 int ret;
1220 1219
1221 mutex_lock(&mthca_device_mutex); 1220 mutex_lock(&mthca_device_mutex);
1222 1221
1223 if (!mthca_version_printed) { 1222 printk_once(KERN_INFO "%s", mthca_version);
1224 printk(KERN_INFO "%s", mthca_version);
1225 ++mthca_version_printed;
1226 }
1227 1223
1228 if (id->driver_data >= ARRAY_SIZE(mthca_hca_table)) { 1224 if (id->driver_data >= ARRAY_SIZE(mthca_hca_table)) {
1229 printk(KERN_ERR PFX "%s has invalid driver data %lx\n", 1225 printk(KERN_ERR PFX "%s has invalid driver data %lx\n",