diff options
Diffstat (limited to 'drivers/input/joydev.c')
-rw-r--r-- | drivers/input/joydev.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 25f7eba4761f..20e2972b9204 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
@@ -448,6 +448,7 @@ static struct file_operations joydev_fops = { | |||
448 | static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) | 448 | static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) |
449 | { | 449 | { |
450 | struct joydev *joydev; | 450 | struct joydev *joydev; |
451 | struct class_device *cdev; | ||
451 | int i, j, t, minor; | 452 | int i, j, t, minor; |
452 | 453 | ||
453 | for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++); | 454 | for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++); |
@@ -513,9 +514,13 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct | |||
513 | 514 | ||
514 | joydev_table[minor] = joydev; | 515 | joydev_table[minor] = joydev; |
515 | 516 | ||
516 | class_device_create(&input_class, &dev->cdev, | 517 | cdev = class_device_create(&input_class, &dev->cdev, |
517 | MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), | 518 | MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), |
518 | dev->cdev.dev, "js%d", minor); | 519 | dev->cdev.dev, joydev->name); |
520 | |||
521 | /* temporary symlink to keep userspace happy */ | ||
522 | sysfs_create_link(&input_class.subsys.kset.kobj, &cdev->kobj, | ||
523 | joydev->name); | ||
519 | 524 | ||
520 | return &joydev->handle; | 525 | return &joydev->handle; |
521 | } | 526 | } |
@@ -525,6 +530,7 @@ static void joydev_disconnect(struct input_handle *handle) | |||
525 | struct joydev *joydev = handle->private; | 530 | struct joydev *joydev = handle->private; |
526 | struct joydev_list *list; | 531 | struct joydev_list *list; |
527 | 532 | ||
533 | sysfs_remove_link(&input_class.subsys.kset.kobj, joydev->name); | ||
528 | class_device_destroy(&input_class, MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor)); | 534 | class_device_destroy(&input_class, MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor)); |
529 | joydev->exist = 0; | 535 | joydev->exist = 0; |
530 | 536 | ||