Hi,

Here's a patch against 2.5.1-pre7 that allows the usbdevfs filesystem to
be mounted as "usbfs".  The "usbdevfs" name is now depreciated, but will
stick around until the next kernel development cycle.  This was done due
to the unfortunate misconceptions that usbdevfs filesystem had something
to do with the devfs filesystem.

thanks,

greg k-h


diff -Nru a/drivers/usb/Config.in b/drivers/usb/Config.in
--- a/drivers/usb/Config.in     Fri Dec  7 21:30:07 2001
+++ b/drivers/usb/Config.in     Fri Dec  7 21:30:07 2001
@@ -9,7 +9,7 @@
    bool '  USB verbose debug messages' CONFIG_USB_DEBUG
 
 comment 'Miscellaneous USB options'
-   bool '  Preliminary USB device filesystem' CONFIG_USB_DEVICEFS
+   bool '  USB device filesystem' CONFIG_USB_DEVICEFS
    if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
       bool '  Enforce USB bandwidth allocation (EXPERIMENTAL)' CONFIG_USB_BANDWIDTH
    else
diff -Nru a/drivers/usb/devio.c b/drivers/usb/devio.c
--- a/drivers/usb/devio.c       Fri Dec  7 21:30:06 2001
+++ b/drivers/usb/devio.c       Fri Dec  7 21:30:06 2001
@@ -276,7 +276,7 @@
                 list_del(&as->asynclist);
                 INIT_LIST_HEAD(&as->asynclist);
                 spin_unlock_irqrestore(&ps->lock, flags);
-                /* usb_unlink_urb calls the completion handler with status == 
USB_ST_URB_KILLED */
+                /* usb_unlink_urb calls the completion handler with status == -ENOENT 
+*/
                 usb_unlink_urb(&as->urb);
                 spin_lock_irqsave(&ps->lock, flags);
         }
@@ -299,11 +299,12 @@
 {
        struct dev_state *ps = (struct dev_state *)context;
 
-       ps->ifclaimed = 0;
+       if (ps)
+               ps->ifclaimed = 0;
 }
 
 struct usb_driver usbdevfs_driver = {
-       name:           "usbdevfs",
+       name:           "usbfs",
        probe:          driver_probe,
        disconnect:     driver_disconnect,
 };
diff -Nru a/drivers/usb/inode.c b/drivers/usb/inode.c
--- a/drivers/usb/inode.c       Fri Dec  7 21:30:08 2001
+++ b/drivers/usb/inode.c       Fri Dec  7 21:30:08 2001
@@ -654,7 +654,13 @@
         return NULL;
 }
 
+/*
+ * The usbdevfs name is now depreciated (as of 2.5.1).
+ * It will be removed when the 2.7.x development cycle is started.
+ * You have been warned :)
+ */
 static DECLARE_FSTYPE(usbdevice_fs_type, "usbdevfs", usbdevfs_read_super, FS_SINGLE);
+static DECLARE_FSTYPE(usb_fs_type, "usbfs", usbdevfs_read_super, FS_SINGLE);
 
 /* --------------------------------------------------------------------- */
 
@@ -747,7 +753,12 @@
        }
        if ((ret = usb_register(&usbdevfs_driver)))
                return ret;
+       if ((ret = register_filesystem(&usb_fs_type))) {
+               usb_deregister(&usbdevfs_driver);
+               return ret;
+       }
        if ((ret = register_filesystem(&usbdevice_fs_type))) {
+               unregister_filesystem(&usb_fs_type);
                usb_deregister(&usbdevfs_driver);
                return ret;
        }
@@ -761,6 +772,7 @@
 void __exit usbdevfs_cleanup(void)
 {
        usb_deregister(&usbdevfs_driver);
+       unregister_filesystem(&usb_fs_type);
        unregister_filesystem(&usbdevice_fs_type);
 #ifdef CONFIG_PROC_FS  
         if (usbdir)
@@ -768,7 +780,3 @@
 #endif
 }
 
-#if 0
-module_init(usbdevfs_init);
-module_exit(usbdevfs_cleanup);
-#endif

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

Reply via email to