Skip to content

Commit

Permalink
USB: remove CONFIG_USB_DEVICEFS
Browse files Browse the repository at this point in the history
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: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Apr 30, 2012
1 parent 70f3c75 commit fb28d58
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 845 deletions.
1 change: 0 additions & 1 deletion drivers/staging/media/go7007/go7007.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ kernel as built-in or modules:
CONFIG_SOUND - Sound card support
CONFIG_SND - Advanced Linux Sound Architecture
CONFIG_USB - Support for Host-side USB
CONFIG_USB_DEVICEFS - USB device filesystem
CONFIG_USB_EHCI_HCD - EHCI HCD (USB 2.0) support

Additionally, to use the example application, the following options need to
Expand Down
29 changes: 0 additions & 29 deletions drivers/usb/core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,6 @@ config USB_ANNOUNCE_NEW_DEVICES
comment "Miscellaneous USB options"
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
bool "USB device class-devices (DEPRECATED)"
depends on USB
Expand Down
1 change: 0 additions & 1 deletion drivers/usb/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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-$(CONFIG_PCI) += hcd-pci.o
usbcore-$(CONFIG_USB_DEVICEFS) += inode.o

obj-$(CONFIG_USB) += usbcore.o
11 changes: 0 additions & 11 deletions drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,17 +727,6 @@ static int usbdev_open(struct inode *inode, struct file *file)
if (imajor(inode) == USB_DEVICE_MAJOR)
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);

if (!dev)
Expand Down
21 changes: 2 additions & 19 deletions drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,16 +726,6 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
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 */
if (add_uevent_var(env, "PRODUCT=%x/%x/%x",
le16_to_cpu(usb_dev->descriptor.idVendor),
Expand Down Expand Up @@ -788,15 +778,13 @@ int usb_register_device_driver(struct usb_device_driver *new_udriver,

retval = driver_register(&new_udriver->drvwrap.driver);

if (!retval) {
if (!retval)
pr_info("%s: registered new device driver %s\n",
usbcore_name, new_udriver->name);
usbfs_update_special();
} else {
else
printk(KERN_ERR "%s: error %d registering device "
" driver %s\n",
usbcore_name, retval, new_udriver->name);
}

return retval;
}
Expand All @@ -815,7 +803,6 @@ void usb_deregister_device_driver(struct usb_device_driver *udriver)
usbcore_name, udriver->name);

driver_unregister(&udriver->drvwrap.driver);
usbfs_update_special();
}
EXPORT_SYMBOL_GPL(usb_deregister_device_driver);

Expand Down Expand Up @@ -856,8 +843,6 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner,
if (retval)
goto out;

usbfs_update_special();

retval = usb_create_newid_files(new_driver);
if (retval)
goto out_newid;
Expand Down Expand Up @@ -897,8 +882,6 @@ void usb_deregister(struct usb_driver *driver)
usb_remove_newid_files(driver);
driver_unregister(&driver->drvwrap.driver);
usb_free_dynids(driver);

usbfs_update_special();
}
EXPORT_SYMBOL_GPL(usb_deregister);

Expand Down
Loading

0 comments on commit fb28d58

Please sign in to comment.