diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 01:25:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 12:52:55 -0400 |
commit | c9bcd582dfeec845b83bc948a430c9958bf839e6 (patch) | |
tree | d17bffdfc868aa355ebd9cc56d1eeb481c0b80d8 /drivers/input/evdev.c | |
parent | ea9f240bd819f9299703283e5326da606bbb4b05 (diff) |
[PATCH] INPUT: Create symlinks for backwards compatibility
This creates symlinks in /sys/class/input/ to the nested class devices
to help userspace cope with the nesting.
Unfortunatly udev still needs to be updated as it can't handle symlinks
properly here :(
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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; |