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 e932526d456120d713ae5a893fbc049bd4fe68ec..c7b482d15e2adb0416785fc837cc9c18b9884667 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 d7e2bec02485bbae83fb323ff3b90fe13cf369af..bf2f046fc2c122d6464dcd4c407433be9c83aa20 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 a1b808346691082c2b1e2d0dac1fee42e36c49de..94b8eb4d691d6b95fd0f32ffeea780dc28a6121c 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 493dba51115bd24e33fab6034fed100d66de1391..d97a53cccdc5227f0ebcd94e0628866744ee0d5c 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 314bc86bf92b3bf32a0a350cd9a0bd64654c3ba8..62616c871c78ad74eca17abf42c0830fcb779b2f 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 214c695a2398b5317d958a6d050e0a08731b167e..5df89e742a338f58c7824b1e8f1e48d9d7e901fd 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 0fc8f639c1d4d9c191f4e0fa28133909545d6f65..b084278f36b74464ba6734c19d65197aa761e69b 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 13c0c3b026904df8d4edbd9b854108513a46cc89..fabe91a8db2b77e958971f2db29b1ee924a4647a 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 28212661f34ac9881b1dacc13abf6c51e1ef532a..2b1f554af0b249ab4263a78f36d948e09b239544 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 5906e9af90648546e091d1de04d3bcc73c24918f..1314cf204f12acd288a831ab67eb0bc7dfe8f25d 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 49cbea33c1412439f0f69512c7d3f7419d683737..e77dd02eccddcba823d2f7faec9f13a97237689d 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 0f604d61365688c545e1e26dd717bd17a221df08..07b73ca2a7e07b2b05d47379c2cca8b7450c5e46 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);
 }