Patch for compilation warnings in ide-cs

Larry W. Finger Larry.Finger at lwfinger.net
Mon Oct 20 17:45:06 BST 2003




In Linux 2.6.0-test7 and previous versions, compilation of 
linux/drivers/ide/legacy/ide-cs.c results in warnings for the deprecated 
macros MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT. In addition, the module 
cannot be unloaded. I submit the following patch, which has been tested on 
my system, for your consideration:

--- linux-2.6.0-test7-orig/drivers/ide/legacy/ide-cs.c
+++ linux-2.6.0-test7/drivers/ide/legacy/ide-cs.c
@@ -362,7 +362,7 @@
         goto failed;
      }

-    MOD_INC_USE_COUNT;
+    __module_get(THIS_MODULE);
      info->ndev = 1;
      sprintf(info->node.dev_name, "hd%c", 'a'+(hd*2));
      info->node.major = ide_major[hd];
@@ -408,7 +408,7 @@
         if (link->io.NumPorts2)
             request_region(link->io.BasePort2, link->io.NumPorts2,
                            info->node.dev_name);
-       MOD_DEC_USE_COUNT;
+       module_put(THIS_MODULE);
      }
      info->ndev = 0;
      link->dev = NULL;

Thanks, Larry  




More information about the linux-pcmcia mailing list