Commit fb28d58b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: remove CONFIG_USB_DEVICEFS

This option has been deprecated for many years now, and no userspace
tools use it anymore, so it should be safe to finally remove it.
Reported-by: default avatarKay Sievers <kay@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 70f3c758
...@@ -87,7 +87,6 @@ kernel as built-in or modules: ...@@ -87,7 +87,6 @@ kernel as built-in or modules:
CONFIG_SOUND - Sound card support CONFIG_SOUND - Sound card support
CONFIG_SND - Advanced Linux Sound Architecture CONFIG_SND - Advanced Linux Sound Architecture
CONFIG_USB - Support for Host-side USB CONFIG_USB - Support for Host-side USB
CONFIG_USB_DEVICEFS - USB device filesystem
CONFIG_USB_EHCI_HCD - EHCI HCD (USB 2.0) support CONFIG_USB_EHCI_HCD - EHCI HCD (USB 2.0) support
Additionally, to use the example application, the following options need to Additionally, to use the example application, the following options need to
......
...@@ -27,35 +27,6 @@ config USB_ANNOUNCE_NEW_DEVICES ...@@ -27,35 +27,6 @@ config USB_ANNOUNCE_NEW_DEVICES
comment "Miscellaneous USB options" comment "Miscellaneous USB options"
depends on USB depends on USB
config USB_DEVICEFS
bool "USB device filesystem (DEPRECATED)"
depends on USB
---help---
If you say Y here (and to "/proc file system support" in the "File
systems" section, above), you will get a file /proc/bus/usb/devices
which lists the devices currently connected to your USB bus or
busses, and for every connected device a file named
"/proc/bus/usb/xxx/yyy", where xxx is the bus number and yyy the
device number; the latter files can be used by user space programs
to talk directly to the device. These files are "virtual", meaning
they are generated on the fly and not stored on the hard drive.
You may need to mount the usbfs file system to see the files, use
mount -t usbfs none /proc/bus/usb
For the format of the various /proc/bus/usb/ files, please read
<file:Documentation/usb/proc_usb_info.txt>.
Modern Linux systems do not use this.
Usbfs entries are files and not character devices; usbfs can't
handle Access Control Lists (ACL) which are the default way to
grant access to USB devices for untrusted users of a desktop
system.
The usbfs functionality is replaced by real device-nodes managed by
udev. These nodes lived in /dev/bus/usb and are used by libusb.
config USB_DEVICE_CLASS config USB_DEVICE_CLASS
bool "USB device class-devices (DEPRECATED)" bool "USB device class-devices (DEPRECATED)"
depends on USB depends on USB
......
...@@ -9,6 +9,5 @@ usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o ...@@ -9,6 +9,5 @@ usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
usbcore-y += devio.o notify.o generic.o quirks.o devices.o usbcore-y += devio.o notify.o generic.o quirks.o devices.o
usbcore-$(CONFIG_PCI) += hcd-pci.o usbcore-$(CONFIG_PCI) += hcd-pci.o
usbcore-$(CONFIG_USB_DEVICEFS) += inode.o
obj-$(CONFIG_USB) += usbcore.o obj-$(CONFIG_USB) += usbcore.o
...@@ -727,17 +727,6 @@ static int usbdev_open(struct inode *inode, struct file *file) ...@@ -727,17 +727,6 @@ static int usbdev_open(struct inode *inode, struct file *file)
if (imajor(inode) == USB_DEVICE_MAJOR) if (imajor(inode) == USB_DEVICE_MAJOR)
dev = usbdev_lookup_by_devt(inode->i_rdev); dev = usbdev_lookup_by_devt(inode->i_rdev);
#ifdef CONFIG_USB_DEVICEFS
/* procfs file */
if (!dev) {
dev = inode->i_private;
if (dev && dev->usbfs_dentry &&
dev->usbfs_dentry->d_inode == inode)
usb_get_dev(dev);
else
dev = NULL;
}
#endif
mutex_unlock(&usbfs_mutex); mutex_unlock(&usbfs_mutex);
if (!dev) if (!dev)
......
...@@ -726,16 +726,6 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env) ...@@ -726,16 +726,6 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
return -ENODEV; return -ENODEV;
} }
#ifdef CONFIG_USB_DEVICEFS
/* If this is available, userspace programs can directly read
* all the device descriptors we don't tell them about. Or
* act as usermode drivers.
*/
if (add_uevent_var(env, "DEVICE=/proc/bus/usb/%03d/%03d",
usb_dev->bus->busnum, usb_dev->devnum))
return -ENOMEM;
#endif
/* per-device configurations are common */ /* per-device configurations are common */
if (add_uevent_var(env, "PRODUCT=%x/%x/%x", if (add_uevent_var(env, "PRODUCT=%x/%x/%x",
le16_to_cpu(usb_dev->descriptor.idVendor), le16_to_cpu(usb_dev->descriptor.idVendor),
...@@ -788,15 +778,13 @@ int usb_register_device_driver(struct usb_device_driver *new_udriver, ...@@ -788,15 +778,13 @@ int usb_register_device_driver(struct usb_device_driver *new_udriver,
retval = driver_register(&new_udriver->drvwrap.driver); retval = driver_register(&new_udriver->drvwrap.driver);
if (!retval) { if (!retval)
pr_info("%s: registered new device driver %s\n", pr_info("%s: registered new device driver %s\n",
usbcore_name, new_udriver->name); usbcore_name, new_udriver->name);
usbfs_update_special(); else
} else {
printk(KERN_ERR "%s: error %d registering device " printk(KERN_ERR "%s: error %d registering device "
" driver %s\n", " driver %s\n",
usbcore_name, retval, new_udriver->name); usbcore_name, retval, new_udriver->name);
}
return retval; return retval;
} }
...@@ -815,7 +803,6 @@ void usb_deregister_device_driver(struct usb_device_driver *udriver) ...@@ -815,7 +803,6 @@ void usb_deregister_device_driver(struct usb_device_driver *udriver)
usbcore_name, udriver->name); usbcore_name, udriver->name);
driver_unregister(&udriver->drvwrap.driver); driver_unregister(&udriver->drvwrap.driver);
usbfs_update_special();
} }
EXPORT_SYMBOL_GPL(usb_deregister_device_driver); EXPORT_SYMBOL_GPL(usb_deregister_device_driver);
...@@ -856,8 +843,6 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner, ...@@ -856,8 +843,6 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner,
if (retval) if (retval)
goto out; goto out;
usbfs_update_special();
retval = usb_create_newid_files(new_driver); retval = usb_create_newid_files(new_driver);
if (retval) if (retval)
goto out_newid; goto out_newid;
...@@ -897,8 +882,6 @@ void usb_deregister(struct usb_driver *driver) ...@@ -897,8 +882,6 @@ void usb_deregister(struct usb_driver *driver)
usb_remove_newid_files(driver); usb_remove_newid_files(driver);
driver_unregister(&driver->drvwrap.driver); driver_unregister(&driver->drvwrap.driver);
usb_free_dynids(driver); usb_free_dynids(driver);
usbfs_update_special();
} }
EXPORT_SYMBOL_GPL(usb_deregister); EXPORT_SYMBOL_GPL(usb_deregister);
......
This diff is collapsed.
...@@ -1030,9 +1030,6 @@ static int __init usb_init(void) ...@@ -1030,9 +1030,6 @@ static int __init usb_init(void)
retval = usb_devio_init(); retval = usb_devio_init();
if (retval) if (retval)
goto usb_devio_init_failed; goto usb_devio_init_failed;
retval = usbfs_init();
if (retval)
goto fs_init_failed;
retval = usb_hub_init(); retval = usb_hub_init();
if (retval) if (retval)
goto hub_init_failed; goto hub_init_failed;
...@@ -1042,8 +1039,6 @@ static int __init usb_init(void) ...@@ -1042,8 +1039,6 @@ static int __init usb_init(void)
usb_hub_cleanup(); usb_hub_cleanup();
hub_init_failed: hub_init_failed:
usbfs_cleanup();
fs_init_failed:
usb_devio_cleanup(); usb_devio_cleanup();
usb_devio_init_failed: usb_devio_init_failed:
usb_deregister(&usbfs_driver); usb_deregister(&usbfs_driver);
...@@ -1070,7 +1065,6 @@ static void __exit usb_exit(void) ...@@ -1070,7 +1065,6 @@ static void __exit usb_exit(void)
usb_deregister_device_driver(&usb_generic_driver); usb_deregister_device_driver(&usb_generic_driver);
usb_major_cleanup(); usb_major_cleanup();
usbfs_cleanup();
usb_deregister(&usbfs_driver); usb_deregister(&usbfs_driver);
usb_devio_cleanup(); usb_devio_cleanup();
usb_hub_cleanup(); usb_hub_cleanup();
......
...@@ -351,10 +351,6 @@ struct usb_bus { ...@@ -351,10 +351,6 @@ struct usb_bus {
int bandwidth_int_reqs; /* number of Interrupt requests */ int bandwidth_int_reqs; /* number of Interrupt requests */
int bandwidth_isoc_reqs; /* number of Isoc. requests */ int bandwidth_isoc_reqs; /* number of Isoc. requests */
#ifdef CONFIG_USB_DEVICEFS
struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
#endif
#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
struct mon_bus *mon_bus; /* non-null when associated */ struct mon_bus *mon_bus; /* non-null when associated */
int monitored; /* non-zero when monitored */ int monitored; /* non-zero when monitored */
...@@ -496,9 +492,6 @@ struct usb_device { ...@@ -496,9 +492,6 @@ struct usb_device {
#ifdef CONFIG_USB_DEVICE_CLASS #ifdef CONFIG_USB_DEVICE_CLASS
struct device *usb_classdev; struct device *usb_classdev;
#endif #endif
#ifdef CONFIG_USB_DEVICEFS
struct dentry *usbfs_dentry;
#endif
int maxchild; int maxchild;
struct usb_device **children; struct usb_device **children;
......
...@@ -582,29 +582,6 @@ static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) ...@@ -582,29 +582,6 @@ static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
} }
#endif /* CONFIG_USB_SUSPEND */ #endif /* CONFIG_USB_SUSPEND */
/*
* USB device fs stuff
*/
#ifdef CONFIG_USB_DEVICEFS
/*
* these are expected to be called from the USB core/hub thread
* with the kernel lock held
*/
extern void usbfs_update_special(void);
extern int usbfs_init(void);
extern void usbfs_cleanup(void);
#else /* CONFIG_USB_DEVICEFS */
static inline void usbfs_update_special(void) {}
static inline int usbfs_init(void) { return 0; }
static inline void usbfs_cleanup(void) { }
#endif /* CONFIG_USB_DEVICEFS */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment