diff options
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r-- | drivers/input/evdev.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 2a96b260a2a8..a4696cd0978c 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -661,6 +661,7 @@ static struct file_operations evdev_fops = { | |||
661 | static struct input_handle *evdev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) | 661 | static struct input_handle *evdev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) |
662 | { | 662 | { |
663 | struct evdev *evdev; | 663 | struct evdev *evdev; |
664 | struct class_device *cdev; | ||
664 | int minor; | 665 | int minor; |
665 | 666 | ||
666 | for (minor = 0; minor < EVDEV_MINORS && evdev_table[minor]; minor++); | 667 | for (minor = 0; minor < EVDEV_MINORS && evdev_table[minor]; minor++); |
@@ -686,9 +687,13 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct | |||
686 | 687 | ||
687 | evdev_table[minor] = evdev; | 688 | evdev_table[minor] = evdev; |
688 | 689 | ||
689 | class_device_create(&input_class, &dev->cdev, | 690 | cdev = class_device_create(&input_class, &dev->cdev, |
690 | MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor), | 691 | MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor), |
691 | dev->cdev.dev, "event%d", minor); | 692 | dev->cdev.dev, evdev->name); |
693 | |||
694 | /* temporary symlink to keep userspace happy */ | ||
695 | sysfs_create_link(&input_class.subsys.kset.kobj, &cdev->kobj, | ||
696 | evdev->name); | ||
692 | 697 | ||
693 | return &evdev->handle; | 698 | return &evdev->handle; |
694 | } | 699 | } |
@@ -698,6 +703,7 @@ static void evdev_disconnect(struct input_handle *handle) | |||
698 | struct evdev *evdev = handle->private; | 703 | struct evdev *evdev = handle->private; |
699 | struct evdev_list *list; | 704 | struct evdev_list *list; |
700 | 705 | ||
706 | sysfs_remove_link(&input_class.subsys.kset.kobj, evdev->name); | ||
701 | class_device_destroy(&input_class, | 707 | class_device_destroy(&input_class, |
702 | MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + evdev->minor)); | 708 | MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + evdev->minor)); |
703 | evdev->exist = 0; | 709 | evdev->exist = 0; |