summaryrefslogtreecommitdiff
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>2009-05-09 16:08:04 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-11 00:11:43 -0700
commit3d5cb60ef3042ac479dab82e5a945966a0d54d53 (patch)
tree08793f3c88b8d218fc934b3769bcc4e2aee993c9 /drivers/input/evdev.c
parent7e044e056a6aa0dc695db50461d7b326fde15e8b (diff)
downloadlinux-3.10-3d5cb60ef3042ac479dab82e5a945966a0d54d53.tar.gz
linux-3.10-3d5cb60ef3042ac479dab82e5a945966a0d54d53.tar.bz2
linux-3.10-3d5cb60ef3042ac479dab82e5a945966a0d54d53.zip
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/evdev.c')
-rw-r--r--drivers/input/evdev.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 7a7a026ba71..c238116400b 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -25,7 +25,6 @@ struct evdev {
int exist;
int open;
int minor;
- char name[16];
struct input_handle handle;
wait_queue_head_t wait;
struct evdev_client *grab;
@@ -609,7 +608,8 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
p, compat_mode);
if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0)))
- return str_to_user(dev->name, _IOC_SIZE(cmd), p);
+ return str_to_user(dev_name(&evdev->dev),
+ _IOC_SIZE(cmd), p);
if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0)))
return str_to_user(dev->phys, _IOC_SIZE(cmd), p);
@@ -807,16 +807,15 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
mutex_init(&evdev->mutex);
init_waitqueue_head(&evdev->wait);
- snprintf(evdev->name, sizeof(evdev->name), "event%d", minor);
+ dev_set_name(&evdev->dev, "event%d", minor);
evdev->exist = 1;
evdev->minor = minor;
evdev->handle.dev = input_get_device(dev);
- evdev->handle.name = evdev->name;
+ evdev->handle.name = dev_name(&evdev->dev);
evdev->handle.handler = handler;
evdev->handle.private = evdev;
- dev_set_name(&evdev->dev, evdev->name);
evdev->dev.devt = MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor);
evdev->dev.class = &input_class;
evdev->dev.parent = &dev->dev;