Skip to content

Commit

Permalink
Input: fix EVIOCGNAME/JSIOCGNAME regression
Browse files Browse the repository at this point in the history
Commit 3d5cb60 ("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: Sven Neumann <s.neumann@raumfeld.com>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Reviewed-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Daniel Mack authored and Dmitry Torokhov committed Jul 14, 2009
1 parent f0a14de commit f936601
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,7 @@ 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(&evdev->dev),
_IOC_SIZE(cmd), p);
return str_to_user(dev->name, _IOC_SIZE(cmd), p);

if (_IOC_NR(cmd) == _IOC_NR(EVIOCGPHYS(0)))
return str_to_user(dev->phys, _IOC_SIZE(cmd), p);
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joydev.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static int joydev_ioctl_common(struct joydev *joydev,
default:
if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) {
int len;
const char *name = dev_name(&dev->dev);
const char *name = dev->name;

if (!name)
return 0;
Expand Down

0 comments on commit f936601

Please sign in to comment.