Skip to content

Commit fb28d58

Browse files
committed
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: Kay Sievers <kay@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 70f3c75 commit fb28d58

File tree

9 files changed

+2
-845
lines changed

9 files changed

+2
-845
lines changed

drivers/staging/media/go7007/go7007.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ kernel as built-in or modules:
8787
CONFIG_SOUND - Sound card support
8888
CONFIG_SND - Advanced Linux Sound Architecture
8989
CONFIG_USB - Support for Host-side USB
90-
CONFIG_USB_DEVICEFS - USB device filesystem
9190
CONFIG_USB_EHCI_HCD - EHCI HCD (USB 2.0) support
9291

9392
Additionally, to use the example application, the following options need to

drivers/usb/core/Kconfig

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,6 @@ config USB_ANNOUNCE_NEW_DEVICES
2727
comment "Miscellaneous USB options"
2828
depends on USB
2929

30-
config USB_DEVICEFS
31-
bool "USB device filesystem (DEPRECATED)"
32-
depends on USB
33-
---help---
34-
If you say Y here (and to "/proc file system support" in the "File
35-
systems" section, above), you will get a file /proc/bus/usb/devices
36-
which lists the devices currently connected to your USB bus or
37-
busses, and for every connected device a file named
38-
"/proc/bus/usb/xxx/yyy", where xxx is the bus number and yyy the
39-
device number; the latter files can be used by user space programs
40-
to talk directly to the device. These files are "virtual", meaning
41-
they are generated on the fly and not stored on the hard drive.
42-
43-
You may need to mount the usbfs file system to see the files, use
44-
mount -t usbfs none /proc/bus/usb
45-
46-
For the format of the various /proc/bus/usb/ files, please read
47-
<file:Documentation/usb/proc_usb_info.txt>.
48-
49-
Modern Linux systems do not use this.
50-
51-
Usbfs entries are files and not character devices; usbfs can't
52-
handle Access Control Lists (ACL) which are the default way to
53-
grant access to USB devices for untrusted users of a desktop
54-
system.
55-
56-
The usbfs functionality is replaced by real device-nodes managed by
57-
udev. These nodes lived in /dev/bus/usb and are used by libusb.
58-
5930
config USB_DEVICE_CLASS
6031
bool "USB device class-devices (DEPRECATED)"
6132
depends on USB

drivers/usb/core/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
99
usbcore-y += devio.o notify.o generic.o quirks.o devices.o
1010

1111
usbcore-$(CONFIG_PCI) += hcd-pci.o
12-
usbcore-$(CONFIG_USB_DEVICEFS) += inode.o
1312

1413
obj-$(CONFIG_USB) += usbcore.o

drivers/usb/core/devio.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -727,17 +727,6 @@ static int usbdev_open(struct inode *inode, struct file *file)
727727
if (imajor(inode) == USB_DEVICE_MAJOR)
728728
dev = usbdev_lookup_by_devt(inode->i_rdev);
729729

730-
#ifdef CONFIG_USB_DEVICEFS
731-
/* procfs file */
732-
if (!dev) {
733-
dev = inode->i_private;
734-
if (dev && dev->usbfs_dentry &&
735-
dev->usbfs_dentry->d_inode == inode)
736-
usb_get_dev(dev);
737-
else
738-
dev = NULL;
739-
}
740-
#endif
741730
mutex_unlock(&usbfs_mutex);
742731

743732
if (!dev)

drivers/usb/core/driver.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -726,16 +726,6 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
726726
return -ENODEV;
727727
}
728728

729-
#ifdef CONFIG_USB_DEVICEFS
730-
/* If this is available, userspace programs can directly read
731-
* all the device descriptors we don't tell them about. Or
732-
* act as usermode drivers.
733-
*/
734-
if (add_uevent_var(env, "DEVICE=/proc/bus/usb/%03d/%03d",
735-
usb_dev->bus->busnum, usb_dev->devnum))
736-
return -ENOMEM;
737-
#endif
738-
739729
/* per-device configurations are common */
740730
if (add_uevent_var(env, "PRODUCT=%x/%x/%x",
741731
le16_to_cpu(usb_dev->descriptor.idVendor),
@@ -788,15 +778,13 @@ int usb_register_device_driver(struct usb_device_driver *new_udriver,
788778

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

791-
if (!retval) {
781+
if (!retval)
792782
pr_info("%s: registered new device driver %s\n",
793783
usbcore_name, new_udriver->name);
794-
usbfs_update_special();
795-
} else {
784+
else
796785
printk(KERN_ERR "%s: error %d registering device "
797786
" driver %s\n",
798787
usbcore_name, retval, new_udriver->name);
799-
}
800788

801789
return retval;
802790
}
@@ -815,7 +803,6 @@ void usb_deregister_device_driver(struct usb_device_driver *udriver)
815803
usbcore_name, udriver->name);
816804

817805
driver_unregister(&udriver->drvwrap.driver);
818-
usbfs_update_special();
819806
}
820807
EXPORT_SYMBOL_GPL(usb_deregister_device_driver);
821808

@@ -856,8 +843,6 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner,
856843
if (retval)
857844
goto out;
858845

859-
usbfs_update_special();
860-
861846
retval = usb_create_newid_files(new_driver);
862847
if (retval)
863848
goto out_newid;
@@ -897,8 +882,6 @@ void usb_deregister(struct usb_driver *driver)
897882
usb_remove_newid_files(driver);
898883
driver_unregister(&driver->drvwrap.driver);
899884
usb_free_dynids(driver);
900-
901-
usbfs_update_special();
902885
}
903886
EXPORT_SYMBOL_GPL(usb_deregister);
904887

0 commit comments

Comments
 (0)