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)
void __exit hiddev_exit(void)
{
devfs_unregister(hiddev_devfs_handle);
usb_deregister(&hiddev_driver);
devfs_remove("usb/hid");
}
......@@ -54,8 +54,6 @@
static tiglusb_t tiglusb[MAXTIGL];
static int timeout = TIMAXTIME; /* timeout in tenth of seconds */
static devfs_handle_t devfs_handle;
/*---------- misc functions ------------------------------------------- */
/*
......@@ -334,7 +332,7 @@ tiglusb_probe (struct usb_interface *intf,
int minor = -1;
int i;
ptiglusb_t s;
char name[8];
char name[32];
dbg ("probing vendor id 0x%x, device id 0x%x",
dev->descriptor.idVendor, dev->descriptor.idProduct);
......@@ -378,13 +376,12 @@ tiglusb_probe (struct usb_interface *intf,
up (&s->mutex);
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",
TIUSB_MAJOR, (TIUSB_MINOR + s->minor), name);
s->devfs =
devfs_register (devfs_handle, name, DEVFS_FL_DEFAULT, TIUSB_MAJOR,
TIUSB_MINOR + s->minor, S_IFCHR | S_IRUGO | S_IWUGO,
&tiglusb_fops, NULL);
devfs_register(NULL, name, DEVFS_FL_DEFAULT, TIUSB_MAJOR,
TIUSB_MINOR + s->minor, S_IFCHR | S_IRUGO | S_IWUGO,
&tiglusb_fops, NULL);
/* Display firmware version */
info ("link cable version %i.%02x",
......@@ -414,8 +411,7 @@ tiglusb_disconnect (struct usb_interface *intf)
s->dev = NULL;
s->opened = 0;
devfs_unregister (s->devfs);
s->devfs = NULL;
devfs_remove (name, "ticables/usb/%d", s->minor);
info ("device %d removed", s->minor);
......@@ -485,7 +481,7 @@ tiglusb_init (void)
}
/* 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 */
result = usb_register (&tiglusb_driver);
......@@ -506,7 +502,7 @@ static void __exit
tiglusb_cleanup (void)
{
usb_deregister (&tiglusb_driver);
devfs_unregister (devfs_handle);
devfs_remove("ticables/usb");
unregister_chrdev (TIUSB_MAJOR, "tiglusb");
}
......
......@@ -38,7 +38,6 @@ typedef struct
wait_queue_head_t remove_ok;
int minor; /* which minor dev #? */
devfs_handle_t devfs; /* devfs device */
driver_state_t state; /* started/stopped */
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