You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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),
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1030,9 +1030,6 @@ static int __init usb_init(void)
|
||||
retval = usb_devio_init();
|
||||
if (retval)
|
||||
goto usb_devio_init_failed;
|
||||
retval = usbfs_init();
|
||||
if (retval)
|
||||
goto fs_init_failed;
|
||||
retval = usb_hub_init();
|
||||
if (retval)
|
||||
goto hub_init_failed;
|
||||
@@ -1042,8 +1039,6 @@ static int __init usb_init(void)
|
||||
|
||||
usb_hub_cleanup();
|
||||
hub_init_failed:
|
||||
usbfs_cleanup();
|
||||
fs_init_failed:
|
||||
usb_devio_cleanup();
|
||||
usb_devio_init_failed:
|
||||
usb_deregister(&usbfs_driver);
|
||||
@@ -1070,7 +1065,6 @@ static void __exit usb_exit(void)
|
||||
|
||||
usb_deregister_device_driver(&usb_generic_driver);
|
||||
usb_major_cleanup();
|
||||
usbfs_cleanup();
|
||||
usb_deregister(&usbfs_driver);
|
||||
usb_devio_cleanup();
|
||||
usb_hub_cleanup();
|
||||
|
||||
@@ -351,10 +351,6 @@ struct usb_bus {
|
||||
int bandwidth_int_reqs; /* number of Interrupt 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)
|
||||
struct mon_bus *mon_bus; /* non-null when associated */
|
||||
int monitored; /* non-zero when monitored */
|
||||
@@ -496,9 +492,6 @@ struct usb_device {
|
||||
#ifdef CONFIG_USB_DEVICE_CLASS
|
||||
struct device *usb_classdev;
|
||||
#endif
|
||||
#ifdef CONFIG_USB_DEVICEFS
|
||||
struct dentry *usbfs_dentry;
|
||||
#endif
|
||||
|
||||
int maxchild;
|
||||
struct usb_device **children;
|
||||
|
||||
@@ -582,29 +582,6 @@ static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
|
||||
}
|
||||
#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)
|
||||
|
||||
Reference in New Issue
Block a user