aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joydev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/joydev.c')
-rw-r--r--drivers/input/joydev.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index e0938d1d3ad7..20e2972b9204 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -26,7 +26,6 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/smp_lock.h> 27#include <linux/smp_lock.h>
28#include <linux/device.h> 28#include <linux/device.h>
29#include <linux/devfs_fs_kernel.h>
30 29
31MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); 30MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
32MODULE_DESCRIPTION("Joystick device interfaces"); 31MODULE_DESCRIPTION("Joystick device interfaces");
@@ -449,6 +448,7 @@ static struct file_operations joydev_fops = {
449static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) 448static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id)
450{ 449{
451 struct joydev *joydev; 450 struct joydev *joydev;
451 struct class_device *cdev;
452 int i, j, t, minor; 452 int i, j, t, minor;
453 453
454 for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++); 454 for (minor = 0; minor < JOYDEV_MINORS && joydev_table[minor]; minor++);
@@ -514,11 +514,13 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
514 514
515 joydev_table[minor] = joydev; 515 joydev_table[minor] = joydev;
516 516
517 devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), 517 cdev = class_device_create(&input_class, &dev->cdev,
518 S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);
519 class_device_create(input_class,
520 MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor), 518 MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
521 dev->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);
522 524
523 return &joydev->handle; 525 return &joydev->handle;
524} 526}
@@ -528,8 +530,8 @@ static void joydev_disconnect(struct input_handle *handle)
528 struct joydev *joydev = handle->private; 530 struct joydev *joydev = handle->private;
529 struct joydev_list *list; 531 struct joydev_list *list;
530 532
531 class_device_destroy(input_class, MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor)); 533 sysfs_remove_link(&input_class.subsys.kset.kobj, joydev->name);
532 devfs_remove("input/js%d", joydev->minor); 534 class_device_destroy(&input_class, MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor));
533 joydev->exist = 0; 535 joydev->exist = 0;
534 536
535 if (joydev->open) { 537 if (joydev->open) {