pcmcia: avoid messages on module (un)loading
authorDominik Brodowski <linux@dominikbrodowski.net>
Sun, 8 Aug 2010 10:27:40 +0000 (12:27 +0200)
committerDominik Brodowski <linux@dominikbrodowski.net>
Wed, 29 Sep 2010 15:20:25 +0000 (17:20 +0200)
printk() statements on module load or unload are frowned upon. Also,
add a few __init or __exit declarations.

Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
12 files changed:
drivers/char/pcmcia/cm4000_cs.c
drivers/char/pcmcia/cm4040_cs.c
drivers/char/pcmcia/ipwireless/main.c
drivers/char/pcmcia/synclink_cs.c
drivers/isdn/hisax/avma1_cs.c
drivers/mtd/maps/pcmciamtd.c
drivers/net/wireless/airo_cs.c
drivers/net/wireless/atmel_cs.c
drivers/net/wireless/orinoco/orinoco_cs.c
drivers/net/wireless/orinoco/spectrum_cs.c
drivers/scsi/pcmcia/aha152x_stub.c
drivers/scsi/pcmcia/nsp_cs.c

index e932526..c7b482d 100644 (file)
@@ -54,8 +54,6 @@
                           __func__ , ## args);         \
        } while (0)
 
-static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald Welte";
-
 #define        T_1SEC          (HZ)
 #define        T_10MSEC        msecs_to_jiffies(10)
 #define        T_20MSEC        msecs_to_jiffies(20)
@@ -1889,8 +1887,6 @@ static int __init cmm_init(void)
 {
        int rc;
 
-       printk(KERN_INFO "%s\n", version);
-
        cmm_class = class_create(THIS_MODULE, "cardman_4000");
        if (IS_ERR(cmm_class))
                return PTR_ERR(cmm_class);
@@ -1915,7 +1911,6 @@ static int __init cmm_init(void)
 
 static void __exit cmm_exit(void)
 {
-       printk(KERN_INFO MODULE_NAME ": unloading\n");
        pcmcia_unregister_driver(&cm4000_driver);
        unregister_chrdev(major, DEVICE_NAME);
        class_destroy(cmm_class);
index d7e2bec..bf2f046 100644 (file)
@@ -48,9 +48,6 @@
                           __func__ , ## args);         \
        } while (0)
 
-static char *version =
-"OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte";
-
 #define        CCID_DRIVER_BULK_DEFAULT_TIMEOUT        (150*HZ)
 #define        CCID_DRIVER_ASYNC_POWERUP_TIMEOUT       (35*HZ)
 #define        CCID_DRIVER_MINIMUM_TIMEOUT             (3*HZ)
@@ -653,7 +650,6 @@ static int __init cm4040_init(void)
 {
        int rc;
 
-       printk(KERN_INFO "%s\n", version);
        cmx_class = class_create(THIS_MODULE, "cardman_4040");
        if (IS_ERR(cmx_class))
                return PTR_ERR(cmx_class);
@@ -678,7 +674,6 @@ static int __init cm4040_init(void)
 
 static void __exit cm4040_exit(void)
 {
-       printk(KERN_INFO MODULE_NAME ": unloading\n");
        pcmcia_unregister_driver(&reader_driver);
        unregister_chrdev(major, DEVICE_NAME);
        class_destroy(cmx_class);
index a1b8083..94b8eb4 100644 (file)
@@ -307,9 +307,6 @@ static int __init init_ipwireless(void)
 {
        int ret;
 
-       printk(KERN_INFO IPWIRELESS_PCCARD_NAME " "
-              IPWIRELESS_PCMCIA_VERSION " by " IPWIRELESS_PCMCIA_AUTHOR "\n");
-
        ret = ipwireless_tty_init();
        if (ret != 0)
                return ret;
@@ -326,9 +323,6 @@ static int __init init_ipwireless(void)
  */
 static void __exit exit_ipwireless(void)
 {
-       printk(KERN_INFO IPWIRELESS_PCCARD_NAME " "
-                       IPWIRELESS_PCMCIA_VERSION " removed\n");
-
        pcmcia_unregister_driver(&me);
        ipwireless_tty_release();
 }
index 493dba5..d97a53c 100644 (file)
@@ -2809,8 +2809,6 @@ static void synclink_cs_cleanup(void)
 {
        int rc;
 
-       printk("Unloading %s: version %s\n", driver_name, driver_version);
-
        while(mgslpc_device_list)
                mgslpc_remove_device(mgslpc_device_list);
 
@@ -2833,8 +2831,6 @@ static int __init synclink_cs_init(void)
            BREAKPOINT();
     }
 
-    printk("%s %s\n", driver_name, driver_version);
-
     if ((rc = pcmcia_register_driver(&mgslpc_driver)) < 0)
            return rc;
 
index 314bc86..62616c8 100644 (file)
@@ -220,7 +220,7 @@ static struct pcmcia_driver avma1cs_driver = {
 
 static int __init init_avma1_cs(void)
 {
-       return(pcmcia_register_driver(&avma1cs_driver));
+       return pcmcia_register_driver(&avma1cs_driver);
 }
 
 static void __exit exit_avma1_cs(void)
index 214c695..5df89e7 100644 (file)
@@ -762,8 +762,6 @@ static struct pcmcia_driver pcmciamtd_driver = {
 
 static int __init init_pcmciamtd(void)
 {
-       info(DRIVER_DESC);
-
        if(bankwidth && bankwidth != 1 && bankwidth != 2) {
                info("bad bankwidth (%d), using default", bankwidth);
                bankwidth = 2;
index 0fc8f63..b084278 100644 (file)
@@ -254,12 +254,12 @@ static struct pcmcia_driver airo_driver = {
        .resume         = airo_resume,
 };
 
-static int airo_cs_init(void)
+static int __init airo_cs_init(void)
 {
        return pcmcia_register_driver(&airo_driver);
 }
 
-static void airo_cs_cleanup(void)
+static void __exit airo_cs_cleanup(void)
 {
        pcmcia_unregister_driver(&airo_driver);
 }
index 13c0c3b..fabe91a 100644 (file)
@@ -317,12 +317,12 @@ static struct pcmcia_driver atmel_driver = {
        .resume         = atmel_resume,
 };
 
-static int atmel_cs_init(void)
+static int __init atmel_cs_init(void)
 {
         return pcmcia_register_driver(&atmel_driver);
 }
 
-static void atmel_cs_cleanup(void)
+static void __exit atmel_cs_cleanup(void)
 {
         pcmcia_unregister_driver(&atmel_driver);
 }
index 2821266..2b1f554 100644 (file)
@@ -281,12 +281,6 @@ static int orinoco_cs_resume(struct pcmcia_device *link)
 /* Module initialization                                           */
 /********************************************************************/
 
-/* Can't be declared "const" or the whole __initdata section will
- * become const */
-static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
-       " (David Gibson <hermes@gibson.dropbear.id.au>, "
-       "Pavel Roskin <proski@gnu.org>, et al)";
-
 static struct pcmcia_device_id orinoco_cs_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), /* 3Com AirConnect PCI 777A */
        PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), /* Lucent Orinoco and old Intersil */
@@ -389,8 +383,6 @@ static struct pcmcia_driver orinoco_driver = {
 static int __init
 init_orinoco_cs(void)
 {
-       printk(KERN_DEBUG "%s\n", version);
-
        return pcmcia_register_driver(&orinoco_driver);
 }
 
index 5906e9a..1314cf2 100644 (file)
@@ -345,12 +345,6 @@ spectrum_cs_resume(struct pcmcia_device *link)
 /* Module initialization                                           */
 /********************************************************************/
 
-/* Can't be declared "const" or the whole __initdata section will
- * become const */
-static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
-       " (Pavel Roskin <proski@gnu.org>,"
-       " David Gibson <hermes@gibson.dropbear.id.au>, et al)";
-
 static struct pcmcia_device_id spectrum_cs_ids[] = {
        PCMCIA_DEVICE_MANF_CARD(0x026c, 0x0001), /* Symbol Spectrum24 LA4137 */
        PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0001), /* Socket Communications CF */
@@ -372,8 +366,6 @@ static struct pcmcia_driver orinoco_driver = {
 static int __init
 init_spectrum_cs(void)
 {
-       printk(KERN_DEBUG "%s\n", version);
-
        return pcmcia_register_driver(&orinoco_driver);
 }
 
index 49cbea3..e77dd02 100644 (file)
@@ -85,8 +85,6 @@ static void aha152x_release_cs(struct pcmcia_device *link);
 static void aha152x_detach(struct pcmcia_device *p_dev);
 static int aha152x_config_cs(struct pcmcia_device *link);
 
-static struct pcmcia_device *dev_list;
-
 static int aha152x_probe(struct pcmcia_device *link)
 {
     scsi_info_t *info;
@@ -231,7 +229,6 @@ static int __init init_aha152x_cs(void)
 static void __exit exit_aha152x_cs(void)
 {
        pcmcia_unregister_driver(&aha152x_cs_driver);
-       BUG_ON(dev_list != NULL);
 }
 
 module_init(init_aha152x_cs);
index 0f604d6..07b73ca 100644 (file)
@@ -1800,14 +1800,11 @@ static struct pcmcia_driver nsp_driver = {
 
 static int __init nsp_cs_init(void)
 {
-       nsp_msg(KERN_INFO, "loading...");
-
        return pcmcia_register_driver(&nsp_driver);
 }
 
 static void __exit nsp_cs_exit(void)
 {
-       nsp_msg(KERN_INFO, "unloading...");
        pcmcia_unregister_driver(&nsp_driver);
 }