This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / input / tsdev.c
index 9c00dbd..18c37d8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $Id: tsdev.c,v 1.15 2002/04/10 16:50:19 jsimmons Exp $
  *
- *  Copyright (c) 2001 "Crazy" james Simmons
+ *  Copyright (c) 2001 "Crazy" james Simmons 
  *
  *  Compaq touchscreen protocol driver. The protocol emulated by this driver
  *  is obsolete; for new programs use the tslib library which can read directly
@@ -177,6 +177,8 @@ static int tsdev_open(struct inode *inode, struct file *file)
 
 static void tsdev_free(struct tsdev *tsdev)
 {
+       devfs_remove("input/ts%d", tsdev->minor);
+       class_simple_device_remove(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + tsdev->minor));
        tsdev_table[tsdev->minor] = NULL;
        kfree(tsdev);
 }
@@ -416,7 +418,7 @@ static struct input_handle *tsdev_connect(struct input_handler *handler,
                        S_IFCHR|S_IRUGO|S_IWUSR, "input/ts%d", minor);
        devfs_mk_cdev(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor + TSDEV_MINORS/2),
                        S_IFCHR|S_IRUGO|S_IWUSR, "input/tsraw%d", minor);
-       class_simple_device_add(input_class,
+       class_simple_device_add(input_class, 
                                MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor),
                                dev->dev, "ts%d", minor);
 
@@ -427,9 +429,6 @@ static void tsdev_disconnect(struct input_handle *handle)
 {
        struct tsdev *tsdev = handle->private;
 
-       class_simple_device_remove(MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + tsdev->minor));
-       devfs_remove("input/ts%d", tsdev->minor);
-       devfs_remove("input/tsraw%d", tsdev->minor);
        tsdev->exist = 0;
 
        if (tsdev->open) {
@@ -437,6 +436,7 @@ static void tsdev_disconnect(struct input_handle *handle)
                wake_up_interruptible(&tsdev->wait);
        } else
                tsdev_free(tsdev);
+       devfs_remove("input/tsraw%d", tsdev->minor);
 }
 
 static struct input_device_id tsdev_ids[] = {