Hi,

the module usage count of that driver was broken. The included patch removes 
it from open/release, as the chardev code does that already and removed from 
probe/disconnect and an owner entry added to the usb_driver structure.

        Regards
                Oliver
--- auerswald.c.alt     Sun Jan 13 19:24:01 2002
+++ auerswald.c Sun Jan 13 19:24:08 2002
@@ -1376,9 +1376,6 @@
        }
        up (&dev_table_mutex);
 
-       /* prevent module unloading */
-       MOD_INC_USE_COUNT;
-
        /* we have access to the device. Now lets allocate memory */
        ccp = (pauerchar_t) kmalloc(sizeof(auerchar_t), GFP_KERNEL);
        if (ccp == NULL) {
@@ -1415,7 +1412,6 @@
        /* Error exit */
 ofail: up (&cp->mutex);
        auerchar_delete (ccp);
-       MOD_DEC_USE_COUNT;
        return ret;
 }
 
@@ -1831,9 +1827,6 @@
        up (&ccp->mutex);
        auerchar_delete (ccp);
 
-       /* release the module */
-       MOD_DEC_USE_COUNT;
-
        return 0;
 }
 
@@ -1892,9 +1885,6 @@
         /* we use only the first -and only- interface */
         if (ifnum != 0) return NULL;
 
-       /* prevent module unloading while sleeping */
-       MOD_INC_USE_COUNT;
-
        /* allocate memory for our device and intialize it */
        cp = kmalloc (sizeof(auerswald_t), GFP_KERNEL);
        if (cp == NULL) {
@@ -2015,7 +2005,6 @@
 
        /* Error exit: clean up the memory */
 pfail: auerswald_delete (cp);
-       MOD_DEC_USE_COUNT;
        return NULL;
 }
 
@@ -2081,8 +2070,6 @@
                }
        }
 
-       /* The device releases this module */
-       MOD_DEC_USE_COUNT;
 }
 
 /* Descriptor for the devices which are served by this driver.
@@ -2102,6 +2089,7 @@
 
 /* Standard usb driver struct */
 static struct usb_driver auerswald_driver = {
+       owner:          THIS_MODULE,
        name:           "auerswald",
        probe:          auerswald_probe,
        disconnect:     auerswald_disconnect,
@@ -2154,3 +2142,4 @@
 module_exit (auerswald_cleanup);
 
 /* --------------------------------------------------------------------- */
+

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to