aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tsdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/tsdev.c')
-rw-r--r--drivers/input/tsdev.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index 75e165736655..ca1547929d62 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -368,6 +368,7 @@ static struct input_handle *tsdev_connect(struct input_handler *handler,
368 struct input_device_id *id) 368 struct input_device_id *id)
369{ 369{
370 struct tsdev *tsdev; 370 struct tsdev *tsdev;
371 struct class_device *cdev;
371 int minor, delta; 372 int minor, delta;
372 373
373 for (minor = 0; minor < TSDEV_MINORS/2 && tsdev_table[minor]; 374 for (minor = 0; minor < TSDEV_MINORS/2 && tsdev_table[minor];
@@ -409,9 +410,13 @@ static struct input_handle *tsdev_connect(struct input_handler *handler,
409 410
410 tsdev_table[minor] = tsdev; 411 tsdev_table[minor] = tsdev;
411 412
412 class_device_create(&input_class, &dev->cdev, 413 cdev = class_device_create(&input_class, &dev->cdev,
413 MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor), 414 MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + minor),
414 dev->cdev.dev, "ts%d", minor); 415 dev->cdev.dev, tsdev->name);
416
417 /* temporary symlink to keep userspace happy */
418 sysfs_create_link(&input_class.subsys.kset.kobj, &cdev->kobj,
419 tsdev->name);
415 420
416 return &tsdev->handle; 421 return &tsdev->handle;
417} 422}
@@ -421,6 +426,7 @@ static void tsdev_disconnect(struct input_handle *handle)
421 struct tsdev *tsdev = handle->private; 426 struct tsdev *tsdev = handle->private;
422 struct tsdev_list *list; 427 struct tsdev_list *list;
423 428
429 sysfs_remove_link(&input_class.subsys.kset.kobj, tsdev->name);
424 class_device_destroy(&input_class, 430 class_device_destroy(&input_class,
425 MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + tsdev->minor)); 431 MKDEV(INPUT_MAJOR, TSDEV_MINOR_BASE + tsdev->minor));
426 tsdev->exist = 0; 432 tsdev->exist = 0;