Commit 436d67c6 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] usb cleanup

	switched to devfs_remove(), killed gratitious devfs_handle_t field.
parent b393f4ef
...@@ -781,6 +781,6 @@ int __init hiddev_init(void) ...@@ -781,6 +781,6 @@ int __init hiddev_init(void)
void __exit hiddev_exit(void) void __exit hiddev_exit(void)
{ {
devfs_unregister(hiddev_devfs_handle);
usb_deregister(&hiddev_driver); usb_deregister(&hiddev_driver);
devfs_remove("usb/hid");
} }
...@@ -54,8 +54,6 @@ ...@@ -54,8 +54,6 @@
static tiglusb_t tiglusb[MAXTIGL]; static tiglusb_t tiglusb[MAXTIGL];
static int timeout = TIMAXTIME; /* timeout in tenth of seconds */ static int timeout = TIMAXTIME; /* timeout in tenth of seconds */
static devfs_handle_t devfs_handle;
/*---------- misc functions ------------------------------------------- */ /*---------- misc functions ------------------------------------------- */
/* /*
...@@ -334,7 +332,7 @@ tiglusb_probe (struct usb_interface *intf, ...@@ -334,7 +332,7 @@ tiglusb_probe (struct usb_interface *intf,
int minor = -1; int minor = -1;
int i; int i;
ptiglusb_t s; ptiglusb_t s;
char name[8]; char name[32];
dbg ("probing vendor id 0x%x, device id 0x%x", dbg ("probing vendor id 0x%x, device id 0x%x",
dev->descriptor.idVendor, dev->descriptor.idProduct); dev->descriptor.idVendor, dev->descriptor.idProduct);
...@@ -378,11 +376,10 @@ tiglusb_probe (struct usb_interface *intf, ...@@ -378,11 +376,10 @@ tiglusb_probe (struct usb_interface *intf,
up (&s->mutex); up (&s->mutex);
dbg ("bound to interface"); dbg ("bound to interface");
sprintf (name, "%d", s->minor); sprintf (name, "ticables/usb/%d", s->minor);
dbg ("registering to devfs : major = %d, minor = %d, node = %s", dbg ("registering to devfs : major = %d, minor = %d, node = %s",
TIUSB_MAJOR, (TIUSB_MINOR + s->minor), name); TIUSB_MAJOR, (TIUSB_MINOR + s->minor), name);
s->devfs = devfs_register(NULL, name, DEVFS_FL_DEFAULT, TIUSB_MAJOR,
devfs_register (devfs_handle, name, DEVFS_FL_DEFAULT, TIUSB_MAJOR,
TIUSB_MINOR + s->minor, S_IFCHR | S_IRUGO | S_IWUGO, TIUSB_MINOR + s->minor, S_IFCHR | S_IRUGO | S_IWUGO,
&tiglusb_fops, NULL); &tiglusb_fops, NULL);
...@@ -414,8 +411,7 @@ tiglusb_disconnect (struct usb_interface *intf) ...@@ -414,8 +411,7 @@ tiglusb_disconnect (struct usb_interface *intf)
s->dev = NULL; s->dev = NULL;
s->opened = 0; s->opened = 0;
devfs_unregister (s->devfs); devfs_remove (name, "ticables/usb/%d", s->minor);
s->devfs = NULL;
info ("device %d removed", s->minor); info ("device %d removed", s->minor);
...@@ -485,7 +481,7 @@ tiglusb_init (void) ...@@ -485,7 +481,7 @@ tiglusb_init (void)
} }
/* Use devfs, tree: /dev/ticables/usb/[0..3] */ /* Use devfs, tree: /dev/ticables/usb/[0..3] */
devfs_handle = devfs_mk_dir (NULL, "ticables/usb", NULL); devfs_mk_dir (NULL, "ticables/usb", NULL);
/* register USB module */ /* register USB module */
result = usb_register (&tiglusb_driver); result = usb_register (&tiglusb_driver);
...@@ -506,7 +502,7 @@ static void __exit ...@@ -506,7 +502,7 @@ static void __exit
tiglusb_cleanup (void) tiglusb_cleanup (void)
{ {
usb_deregister (&tiglusb_driver); usb_deregister (&tiglusb_driver);
devfs_unregister (devfs_handle); devfs_remove("ticables/usb");
unregister_chrdev (TIUSB_MAJOR, "tiglusb"); unregister_chrdev (TIUSB_MAJOR, "tiglusb");
} }
......
...@@ -38,7 +38,6 @@ typedef struct ...@@ -38,7 +38,6 @@ typedef struct
wait_queue_head_t remove_ok; wait_queue_head_t remove_ok;
int minor; /* which minor dev #? */ int minor; /* which minor dev #? */
devfs_handle_t devfs; /* devfs device */
driver_state_t state; /* started/stopped */ driver_state_t state; /* started/stopped */
int opened; /* tru if open */ int opened; /* tru if open */
......
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