[PATCH] CCISS: Don't print driver version until we actually find a device

From: Bjorn Helgaas
Date: Tue Jul 25 2006 - 18:34:42 EST


If we don't find any devices, we shouldn't print anything.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx>

Index: work-mm2/drivers/block/cciss.c
===================================================================
--- work-mm2.orig/drivers/block/cciss.c 2006-07-20 16:27:34.000000000 -0600
+++ work-mm2/drivers/block/cciss.c 2006-07-25 16:16:27.000000000 -0600
@@ -3109,12 +3109,16 @@
static int __devinit cciss_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
+ static int cciss_version_printed = 0;
request_queue_t *q;
int i;
int j;
int rc;
int dac;

+ if (cciss_version_printed++ == 0)
+ printk(KERN_INFO DRIVER_NAME "\n");
+
i = alloc_cciss_hba();
if (i < 0)
return -1;
@@ -3370,9 +3374,6 @@
*/
static int __init cciss_init(void)
{
- printk(KERN_INFO DRIVER_NAME "\n");
-
- /* Register for our PCI devices */
return pci_register_driver(&cciss_pci_driver);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/