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>
This commit is contained in:
parent
181c74e87e
commit
f1aa78b26e
@ -105,11 +105,9 @@ static void rnic_init(struct iwch_dev *rnicp)
|
|||||||
static void open_rnic_dev(struct t3cdev *tdev)
|
static void open_rnic_dev(struct t3cdev *tdev)
|
||||||
{
|
{
|
||||||
struct iwch_dev *rnicp;
|
struct iwch_dev *rnicp;
|
||||||
static int vers_printed;
|
|
||||||
|
|
||||||
PDBG("%s t3cdev %p\n", __func__, tdev);
|
PDBG("%s t3cdev %p\n", __func__, tdev);
|
||||||
if (!vers_printed++)
|
printk_once(KERN_INFO MOD "Chelsio T3 RDMA Driver - version %s\n",
|
||||||
printk(KERN_INFO MOD "Chelsio T3 RDMA Driver - version %s\n",
|
|
||||||
DRV_VERSION);
|
DRV_VERSION);
|
||||||
rnicp = (struct iwch_dev *)ib_alloc_device(sizeof(*rnicp));
|
rnicp = (struct iwch_dev *)ib_alloc_device(sizeof(*rnicp));
|
||||||
if (!rnicp) {
|
if (!rnicp) {
|
||||||
|
@ -540,15 +540,11 @@ static struct device_attribute *mlx4_class_attributes[] = {
|
|||||||
|
|
||||||
static void *mlx4_ib_add(struct mlx4_dev *dev)
|
static void *mlx4_ib_add(struct mlx4_dev *dev)
|
||||||
{
|
{
|
||||||
static int mlx4_ib_version_printed;
|
|
||||||
struct mlx4_ib_dev *ibdev;
|
struct mlx4_ib_dev *ibdev;
|
||||||
int num_ports = 0;
|
int num_ports = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!mlx4_ib_version_printed) {
|
printk_once(KERN_INFO "%s", mlx4_ib_version);
|
||||||
printk(KERN_INFO "%s", mlx4_ib_version);
|
|
||||||
++mlx4_ib_version_printed;
|
|
||||||
}
|
|
||||||
|
|
||||||
mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
|
mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_IB)
|
||||||
num_ports++;
|
num_ports++;
|
||||||
|
@ -1215,15 +1215,11 @@ int __mthca_restart_one(struct pci_dev *pdev)
|
|||||||
static int __devinit mthca_init_one(struct pci_dev *pdev,
|
static int __devinit mthca_init_one(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *id)
|
const struct pci_device_id *id)
|
||||||
{
|
{
|
||||||
static int mthca_version_printed = 0;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_lock(&mthca_device_mutex);
|
mutex_lock(&mthca_device_mutex);
|
||||||
|
|
||||||
if (!mthca_version_printed) {
|
printk_once(KERN_INFO "%s", mthca_version);
|
||||||
printk(KERN_INFO "%s", mthca_version);
|
|
||||||
++mthca_version_printed;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id->driver_data >= ARRAY_SIZE(mthca_hca_table)) {
|
if (id->driver_data >= ARRAY_SIZE(mthca_hca_table)) {
|
||||||
printk(KERN_ERR PFX "%s has invalid driver data %lx\n",
|
printk(KERN_ERR PFX "%s has invalid driver data %lx\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user