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

USB: remove usbdevfs filesystem name, usbfs is the proper one to use.

This has been publicised for years now, and the usvfs name will work just
fine with a 2.4 kernel, so we are not breaking backwards compatibility.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 66d2dc06
...@@ -149,7 +149,7 @@ static const struct class_info clas_info[] = ...@@ -149,7 +149,7 @@ static const struct class_info clas_info[] =
/*****************************************************************/ /*****************************************************************/
void usbdevfs_conn_disc_event(void) void usbfs_conn_disc_event(void)
{ {
conndiscevcnt++; conndiscevcnt++;
wake_up(&deviceconndiscwq); wake_up(&deviceconndiscwq);
...@@ -682,7 +682,7 @@ static loff_t usb_device_lseek(struct file * file, loff_t offset, int orig) ...@@ -682,7 +682,7 @@ static loff_t usb_device_lseek(struct file * file, loff_t offset, int orig)
return ret; return ret;
} }
struct file_operations usbdevfs_devices_fops = { struct file_operations usbfs_devices_fops = {
.llseek = usb_device_lseek, .llseek = usb_device_lseek,
.read = usb_device_read, .read = usb_device_read,
.poll = usb_device_poll, .poll = usb_device_poll,
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* $Id: devio.c,v 1.7 2000/02/01 17:28:48 fliegl Exp $ * $Id: devio.c,v 1.7 2000/02/01 17:28:48 fliegl Exp $
* *
* This file implements the usbdevfs/x/y files, where * This file implements the usbfs/x/y files, where
* x is the bus number and y the device number. * x is the bus number and y the device number.
* *
* It allows user space programs/"drivers" to communicate directly * It allows user space programs/"drivers" to communicate directly
...@@ -354,7 +354,7 @@ static void driver_disconnect(struct usb_interface *intf) ...@@ -354,7 +354,7 @@ static void driver_disconnect(struct usb_interface *intf)
destroy_async_on_interface(ps, ifnum); destroy_async_on_interface(ps, ifnum);
} }
struct usb_driver usbdevfs_driver = { struct usb_driver usbfs_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "usbfs", .name = "usbfs",
.probe = driver_probe, .probe = driver_probe,
...@@ -379,7 +379,7 @@ static int claimintf(struct dev_state *ps, unsigned int ifnum) ...@@ -379,7 +379,7 @@ static int claimintf(struct dev_state *ps, unsigned int ifnum)
if (!intf) if (!intf)
err = -ENOENT; err = -ENOENT;
else else
err = usb_driver_claim_interface(&usbdevfs_driver, intf, ps); err = usb_driver_claim_interface(&usbfs_driver, intf, ps);
up_write(&usb_bus_type.subsys.rwsem); up_write(&usb_bus_type.subsys.rwsem);
if (err == 0) if (err == 0)
set_bit(ifnum, &ps->ifclaimed); set_bit(ifnum, &ps->ifclaimed);
...@@ -402,7 +402,7 @@ static int releaseintf(struct dev_state *ps, unsigned int ifnum) ...@@ -402,7 +402,7 @@ static int releaseintf(struct dev_state *ps, unsigned int ifnum)
if (!intf) if (!intf)
err = -ENOENT; err = -ENOENT;
else if (test_and_clear_bit(ifnum, &ps->ifclaimed)) { else if (test_and_clear_bit(ifnum, &ps->ifclaimed)) {
usb_driver_release_interface(&usbdevfs_driver, intf); usb_driver_release_interface(&usbfs_driver, intf);
err = 0; err = 0;
} }
up_write(&usb_bus_type.subsys.rwsem); up_write(&usb_bus_type.subsys.rwsem);
...@@ -1315,7 +1315,7 @@ static unsigned int usbdev_poll(struct file *file, struct poll_table_struct *wai ...@@ -1315,7 +1315,7 @@ static unsigned int usbdev_poll(struct file *file, struct poll_table_struct *wai
return mask; return mask;
} }
struct file_operations usbdevfs_device_file_operations = { struct file_operations usbfs_device_file_operations = {
.llseek = usbdev_lseek, .llseek = usbdev_lseek,
.read = usbdev_read, .read = usbdev_read,
.poll = usbdev_poll, .poll = usbdev_poll,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* inode.c -- Inode/Dentry functions for the USB device file system. * inode.c -- Inode/Dentry functions for the USB device file system.
* *
* Copyright (C) 2000 Thomas Sailer (sailer@ife.ee.ethz.ch) * Copyright (C) 2000 Thomas Sailer (sailer@ife.ee.ethz.ch)
* Copyright (C) 2001,2002 Greg Kroah-Hartman (greg@kroah.com) * Copyright (C) 2001,2002,2004 Greg Kroah-Hartman (greg@kroah.com)
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -40,17 +40,15 @@ ...@@ -40,17 +40,15 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/parser.h> #include <linux/parser.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include "usb.h"
static struct super_operations usbfs_ops; static struct super_operations usbfs_ops;
static struct file_operations default_file_operations; static struct file_operations default_file_operations;
static struct inode_operations usbfs_dir_inode_operations; static struct inode_operations usbfs_dir_inode_operations;
static struct vfsmount *usbdevfs_mount;
static struct vfsmount *usbfs_mount; static struct vfsmount *usbfs_mount;
static int usbdevfs_mount_count; /* = 0 */
static int usbfs_mount_count; /* = 0 */ static int usbfs_mount_count; /* = 0 */
static int ignore_mount = 0; static int ignore_mount = 0;
static struct dentry *devices_usbdevfs_dentry;
static struct dentry *devices_usbfs_dentry; static struct dentry *devices_usbfs_dentry;
static int num_buses; /* = 0 */ static int num_buses; /* = 0 */
...@@ -240,9 +238,6 @@ static int remount(struct super_block *sb, int *flags, char *data) ...@@ -240,9 +238,6 @@ static int remount(struct super_block *sb, int *flags, char *data)
if (usbfs_mount && usbfs_mount->mnt_sb) if (usbfs_mount && usbfs_mount->mnt_sb)
update_sb(usbfs_mount->mnt_sb); update_sb(usbfs_mount->mnt_sb);
if (usbdevfs_mount && usbdevfs_mount->mnt_sb)
update_sb(usbdevfs_mount->mnt_sb);
return 0; return 0;
} }
...@@ -561,28 +556,12 @@ static void fs_remove_file (struct dentry *dentry) ...@@ -561,28 +556,12 @@ static void fs_remove_file (struct dentry *dentry)
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/*
* The usbdevfs name is now deprecated (as of 2.5.1).
* It will be removed when the 2.7.x development cycle is started.
* You have been warned :)
*/
static struct file_system_type usbdevice_fs_type;
static struct super_block *usb_get_sb(struct file_system_type *fs_type, static struct super_block *usb_get_sb(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data) int flags, const char *dev_name, void *data)
{ {
return get_sb_single(fs_type, flags, data, usbfs_fill_super); return get_sb_single(fs_type, flags, data, usbfs_fill_super);
} }
static struct file_system_type usbdevice_fs_type = {
.owner = THIS_MODULE,
.name = "usbdevfs",
.get_sb = usb_get_sb,
.kill_sb = kill_litter_super,
};
static struct file_system_type usb_fs_type = { static struct file_system_type usb_fs_type = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "usbfs", .name = "usbfs",
...@@ -603,16 +582,10 @@ static int create_special_files (void) ...@@ -603,16 +582,10 @@ static int create_special_files (void)
ignore_mount = 1; ignore_mount = 1;
/* create the devices special file */ /* create the devices special file */
retval = simple_pin_fs("usbdevfs", &usbdevfs_mount, &usbdevfs_mount_count);
if (retval) {
err ("Unable to get usbdevfs mount");
goto exit;
}
retval = simple_pin_fs("usbfs", &usbfs_mount, &usbfs_mount_count); retval = simple_pin_fs("usbfs", &usbfs_mount, &usbfs_mount_count);
if (retval) { if (retval) {
err ("Unable to get usbfs mount"); err ("Unable to get usbfs mount");
goto error_clean_usbdevfs_mount; goto exit;
} }
ignore_mount = 0; ignore_mount = 0;
...@@ -620,7 +593,7 @@ static int create_special_files (void) ...@@ -620,7 +593,7 @@ static int create_special_files (void)
parent = usbfs_mount->mnt_sb->s_root; parent = usbfs_mount->mnt_sb->s_root;
devices_usbfs_dentry = fs_create_file ("devices", devices_usbfs_dentry = fs_create_file ("devices",
listmode | S_IFREG, parent, listmode | S_IFREG, parent,
NULL, &usbdevfs_devices_fops, NULL, &usbfs_devices_fops,
listuid, listgid); listuid, listgid);
if (devices_usbfs_dentry == NULL) { if (devices_usbfs_dentry == NULL) {
err ("Unable to create devices usbfs file"); err ("Unable to create devices usbfs file");
...@@ -628,42 +601,19 @@ static int create_special_files (void) ...@@ -628,42 +601,19 @@ static int create_special_files (void)
goto error_clean_mounts; goto error_clean_mounts;
} }
parent = usbdevfs_mount->mnt_sb->s_root;
devices_usbdevfs_dentry = fs_create_file ("devices",
listmode | S_IFREG, parent,
NULL, &usbdevfs_devices_fops,
listuid, listgid);
if (devices_usbdevfs_dentry == NULL) {
err ("Unable to create devices usbfs file");
retval = -ENODEV;
goto error_remove_file;
}
goto exit; goto exit;
error_remove_file:
fs_remove_file (devices_usbfs_dentry);
devices_usbfs_dentry = NULL;
error_clean_mounts: error_clean_mounts:
simple_release_fs(&usbfs_mount, &usbfs_mount_count); simple_release_fs(&usbfs_mount, &usbfs_mount_count);
error_clean_usbdevfs_mount:
simple_release_fs(&usbdevfs_mount, &usbdevfs_mount_count);
exit: exit:
return retval; return retval;
} }
static void remove_special_files (void) static void remove_special_files (void)
{ {
if (devices_usbdevfs_dentry)
fs_remove_file (devices_usbdevfs_dentry);
if (devices_usbfs_dentry) if (devices_usbfs_dentry)
fs_remove_file (devices_usbfs_dentry); fs_remove_file (devices_usbfs_dentry);
devices_usbdevfs_dentry = NULL;
devices_usbfs_dentry = NULL; devices_usbfs_dentry = NULL;
simple_release_fs(&usbdevfs_mount, &usbdevfs_mount_count);
simple_release_fs(&usbfs_mount, &usbfs_mount_count); simple_release_fs(&usbfs_mount, &usbfs_mount_count);
} }
...@@ -671,11 +621,6 @@ void usbfs_update_special (void) ...@@ -671,11 +621,6 @@ void usbfs_update_special (void)
{ {
struct inode *inode; struct inode *inode;
if (devices_usbdevfs_dentry) {
inode = devices_usbdevfs_dentry->d_inode;
if (inode)
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
}
if (devices_usbfs_dentry) { if (devices_usbfs_dentry) {
inode = devices_usbfs_dentry->d_inode; inode = devices_usbfs_dentry->d_inode;
if (inode) if (inode)
...@@ -707,29 +652,16 @@ void usbfs_add_bus(struct usb_bus *bus) ...@@ -707,29 +652,16 @@ void usbfs_add_bus(struct usb_bus *bus)
return; return;
} }
parent = usbdevfs_mount->mnt_sb->s_root;
bus->usbdevfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent,
bus, NULL, busuid, busgid);
if (bus->usbdevfs_dentry == NULL) {
err ("error creating usbdevfs bus entry");
return;
}
usbfs_update_special(); usbfs_update_special();
usbdevfs_conn_disc_event(); usbfs_conn_disc_event();
} }
void usbfs_remove_bus(struct usb_bus *bus) void usbfs_remove_bus(struct usb_bus *bus)
{ {
if (bus->usbfs_dentry) { if (bus->usbfs_dentry) {
fs_remove_file (bus->usbfs_dentry); fs_remove_file (bus->usbfs_dentry);
bus->usbfs_dentry = NULL; bus->usbfs_dentry = NULL;
} }
if (bus->usbdevfs_dentry) {
fs_remove_file (bus->usbdevfs_dentry);
bus->usbdevfs_dentry = NULL;
}
--num_buses; --num_buses;
if (num_buses <= 0) { if (num_buses <= 0) {
...@@ -738,7 +670,7 @@ void usbfs_remove_bus(struct usb_bus *bus) ...@@ -738,7 +670,7 @@ void usbfs_remove_bus(struct usb_bus *bus)
} }
usbfs_update_special(); usbfs_update_special();
usbdevfs_conn_disc_event(); usbfs_conn_disc_event();
} }
void usbfs_add_device(struct usb_device *dev) void usbfs_add_device(struct usb_device *dev)
...@@ -750,20 +682,12 @@ void usbfs_add_device(struct usb_device *dev) ...@@ -750,20 +682,12 @@ void usbfs_add_device(struct usb_device *dev)
sprintf (name, "%03d", dev->devnum); sprintf (name, "%03d", dev->devnum);
dev->usbfs_dentry = fs_create_file (name, devmode | S_IFREG, dev->usbfs_dentry = fs_create_file (name, devmode | S_IFREG,
dev->bus->usbfs_dentry, dev, dev->bus->usbfs_dentry, dev,
&usbdevfs_device_file_operations, &usbfs_device_file_operations,
devuid, devgid); devuid, devgid);
if (dev->usbfs_dentry == NULL) { if (dev->usbfs_dentry == NULL) {
err ("error creating usbfs device entry"); err ("error creating usbfs device entry");
return; return;
} }
dev->usbdevfs_dentry = fs_create_file (name, devmode | S_IFREG,
dev->bus->usbdevfs_dentry, dev,
&usbdevfs_device_file_operations,
devuid, devgid);
if (dev->usbdevfs_dentry == NULL) {
err ("error creating usbdevfs device entry");
return;
}
/* Set the size of the device's file to be /* Set the size of the device's file to be
* equal to the size of the device descriptors. */ * equal to the size of the device descriptors. */
...@@ -775,11 +699,9 @@ void usbfs_add_device(struct usb_device *dev) ...@@ -775,11 +699,9 @@ void usbfs_add_device(struct usb_device *dev)
} }
if (dev->usbfs_dentry->d_inode) if (dev->usbfs_dentry->d_inode)
dev->usbfs_dentry->d_inode->i_size = i_size; dev->usbfs_dentry->d_inode->i_size = i_size;
if (dev->usbdevfs_dentry->d_inode)
dev->usbdevfs_dentry->d_inode->i_size = i_size;
usbfs_update_special(); usbfs_update_special();
usbdevfs_conn_disc_event(); usbfs_conn_disc_event();
} }
void usbfs_remove_device(struct usb_device *dev) void usbfs_remove_device(struct usb_device *dev)
...@@ -791,10 +713,6 @@ void usbfs_remove_device(struct usb_device *dev) ...@@ -791,10 +713,6 @@ void usbfs_remove_device(struct usb_device *dev)
fs_remove_file (dev->usbfs_dentry); fs_remove_file (dev->usbfs_dentry);
dev->usbfs_dentry = NULL; dev->usbfs_dentry = NULL;
} }
if (dev->usbdevfs_dentry) {
fs_remove_file (dev->usbdevfs_dentry);
dev->usbdevfs_dentry = NULL;
}
while (!list_empty(&dev->filelist)) { while (!list_empty(&dev->filelist)) {
ds = list_entry(dev->filelist.next, struct dev_state, list); ds = list_entry(dev->filelist.next, struct dev_state, list);
list_del_init(&ds->list); list_del_init(&ds->list);
...@@ -807,51 +725,38 @@ void usbfs_remove_device(struct usb_device *dev) ...@@ -807,51 +725,38 @@ void usbfs_remove_device(struct usb_device *dev)
} }
} }
usbfs_update_special(); usbfs_update_special();
usbdevfs_conn_disc_event(); usbfs_conn_disc_event();
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *usbdir = NULL; static struct proc_dir_entry *usbdir = NULL;
#endif
int __init usbfs_init(void) int __init usbfs_init(void)
{ {
int retval; int retval;
retval = usb_register(&usbdevfs_driver); retval = usb_register(&usbfs_driver);
if (retval) if (retval)
return retval; return retval;
retval = register_filesystem(&usb_fs_type); retval = register_filesystem(&usb_fs_type);
if (retval) { if (retval) {
usb_deregister(&usbdevfs_driver); usb_deregister(&usbfs_driver);
return retval;
}
retval = register_filesystem(&usbdevice_fs_type);
if (retval) {
unregister_filesystem(&usb_fs_type);
usb_deregister(&usbdevfs_driver);
return retval; return retval;
} }
#ifdef CONFIG_PROC_FS /* create mount point for usbfs */
/* create mount point for usbdevfs */
usbdir = proc_mkdir("usb", proc_bus); usbdir = proc_mkdir("usb", proc_bus);
#endif
return 0; return 0;
} }
void usbfs_cleanup(void) void usbfs_cleanup(void)
{ {
usb_deregister(&usbdevfs_driver); usb_deregister(&usbfs_driver);
unregister_filesystem(&usb_fs_type); unregister_filesystem(&usb_fs_type);
unregister_filesystem(&usbdevice_fs_type);
#ifdef CONFIG_PROC_FS
if (usbdir) if (usbdir)
remove_proc_entry("usb", proc_bus); remove_proc_entry("usb", proc_bus);
#endif
} }
...@@ -27,3 +27,9 @@ extern void usb_set_device_state(struct usb_device *udev, ...@@ -27,3 +27,9 @@ extern void usb_set_device_state(struct usb_device *udev,
/* for labeling diagnostics */ /* for labeling diagnostics */
extern const char *usbcore_name; extern const char *usbcore_name;
/* usbfs stuff */
extern struct usb_driver usbfs_driver;
extern struct file_operations usbfs_devices_fops;
extern struct file_operations usbfs_device_file_operations;
extern void usbfs_conn_disc_event(void);
...@@ -264,7 +264,6 @@ struct usb_bus { ...@@ -264,7 +264,6 @@ struct usb_bus {
int bandwidth_isoc_reqs; /* number of Isoc. requests */ int bandwidth_isoc_reqs; /* number of Isoc. requests */
struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
struct dentry *usbdevfs_dentry; /* usbdevfs dentry entry for the bus */
struct class_device class_dev; /* class device for this bus */ struct class_device class_dev; /* class device for this bus */
void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */
...@@ -315,7 +314,6 @@ struct usb_device { ...@@ -315,7 +314,6 @@ struct usb_device {
struct list_head filelist; struct list_head filelist;
struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
struct dentry *usbdevfs_dentry; /* usbdevfs dentry entry for the device */
/* /*
* Child devices - these can be either new devices * Child devices - these can be either new devices
......
...@@ -166,16 +166,6 @@ struct dev_state { ...@@ -166,16 +166,6 @@ struct dev_state {
unsigned long ifclaimed; unsigned long ifclaimed;
}; };
/* internal methods & data */
extern struct usb_driver usbdevfs_driver;
extern struct file_operations usbdevfs_drivers_fops;
extern struct file_operations usbdevfs_devices_fops;
extern struct file_operations usbdevfs_device_file_operations;
extern struct inode_operations usbdevfs_device_inode_operations;
extern struct inode_operations usbdevfs_bus_inode_operations;
extern struct file_operations usbdevfs_bus_file_operations;
extern void usbdevfs_conn_disc_event(void);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
......
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