aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mousedev.c
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>2009-05-09 19:08:04 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-11 03:11:43 -0400
commit3d5cb60ef3042ac479dab82e5a945966a0d54d53 (patch)
tree08793f3c88b8d218fc934b3769bcc4e2aee993c9 /drivers/input/mousedev.c
parent7e044e056a6aa0dc695db50461d7b326fde15e8b (diff)
Input: simplify name handling for certain input handles
For evdev, joydev and mousedev, instead of having a separate character array holding name of the handle, use struct devce's name which is the same. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mousedev.c')
-rw-r--r--drivers/input/mousedev.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 17fd6d46d082..966b8868f792 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -60,7 +60,6 @@ struct mousedev {
60 int exist; 60 int exist;
61 int open; 61 int open;
62 int minor; 62 int minor;
63 char name[16];
64 struct input_handle handle; 63 struct input_handle handle;
65 wait_queue_head_t wait; 64 wait_queue_head_t wait;
66 struct list_head client_list; 65 struct list_head client_list;
@@ -863,19 +862,17 @@ static struct mousedev *mousedev_create(struct input_dev *dev,
863 init_waitqueue_head(&mousedev->wait); 862 init_waitqueue_head(&mousedev->wait);
864 863
865 if (minor == MOUSEDEV_MIX) 864 if (minor == MOUSEDEV_MIX)
866 strlcpy(mousedev->name, "mice", sizeof(mousedev->name)); 865 dev_set_name(&mousedev->dev, "mice");
867 else 866 else
868 snprintf(mousedev->name, sizeof(mousedev->name), 867 dev_set_name(&mousedev->dev, "mouse%d", minor);
869 "mouse%d", minor);
870 868
871 mousedev->minor = minor; 869 mousedev->minor = minor;
872 mousedev->exist = 1; 870 mousedev->exist = 1;
873 mousedev->handle.dev = input_get_device(dev); 871 mousedev->handle.dev = input_get_device(dev);
874 mousedev->handle.name = mousedev->name; 872 mousedev->handle.name = dev_name(&mousedev->dev);
875 mousedev->handle.handler = handler; 873 mousedev->handle.handler = handler;
876 mousedev->handle.private = mousedev; 874 mousedev->handle.private = mousedev;
877 875
878 dev_set_name(&mousedev->dev, mousedev->name);
879 mousedev->dev.class = &input_class; 876 mousedev->dev.class = &input_class;
880 if (dev) 877 if (dev)
881 mousedev->dev.parent = &dev->dev; 878 mousedev->dev.parent = &dev->dev;