Commit f9366014 authored by Daniel Mack's avatar Daniel Mack Committed by Dmitry Torokhov

Input: fix EVIOCGNAME/JSIOCGNAME regression

Commit 3d5cb60e ("Input: simplify name handling for certain input
handles") introduced a regression for the EVIOCGNAME/JSIOCGNAME
ioctl.

Before this, patch, the platform device's name was given back to
userspace which was good to identify devices. After this patch, the
device is ("event%d", minor) which is not descriptive at all.

This fixes the behaviour by taking dev->name.
Reported-by: default avatarSven Neumann <s.neumann@raumfeld.com>
Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
Reviewed-by: default avatarThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent f0a14de2
...@@ -608,8 +608,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, ...@@ -608,8 +608,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
p, compat_mode); p, compat_mode);
if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0)))
return str_to_user(dev_name(&evdev->dev), return str_to_user(dev->name, _IOC_SIZE(cmd), p);
_IOC_SIZE(cmd), p);
if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0))) if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0)))
return str_to_user(dev->phys, _IOC_SIZE(cmd), p); return str_to_user(dev->phys, _IOC_SIZE(cmd), p);
......
...@@ -536,7 +536,7 @@ static int joydev_ioctl_common(struct joydev *joydev, ...@@ -536,7 +536,7 @@ static int joydev_ioctl_common(struct joydev *joydev,
default: default:
if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) { if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) {
int len; int len;
const char *name = dev_name(&dev->dev); const char *name = dev->name;
if (!name) if (!name)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment