summaryrefslogtreecommitdiff
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
authorVojtech Pavlik <vojtech@twilight.ucw.cz>2002-07-25 02:57:12 +0200
committerVojtech Pavlik <vojtech@twilight.ucw.cz>2002-07-25 02:57:12 +0200
commit7d30d1df118d5b27a559e590475897e1b09f0ebe (patch)
tree265dd5ea0002f735fd741434c21d64cbeedcd969 /drivers/input/evdev.c
parent5ab506c839e31507399184d6952b9bb62ff2188f (diff)
This patch by Brad Hards replaces the four id* fields of the input
struct by a single struct to simplify passing it around and to userspace.
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r--drivers/input/evdev.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 0a2f930cf585..af7abcf21c53 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -233,6 +233,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct evdev_list *list = file->private_data;
struct evdev *evdev = list->evdev;
struct input_dev *dev = evdev->handle.dev;
+ struct input_devinfo id;
int retval, t, u;
if (!evdev->exist) return -ENODEV;
@@ -243,11 +244,12 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
return put_user(EV_VERSION, (int *) arg);
case EVIOCGID:
- if ((retval = put_user(dev->idbus, ((short *) arg) + 0))) return retval;
- if ((retval = put_user(dev->idvendor, ((short *) arg) + 1))) return retval;
- if ((retval = put_user(dev->idproduct, ((short *) arg) + 2))) return retval;
- if ((retval = put_user(dev->idversion, ((short *) arg) + 3))) return retval;
- return 0;
+ id.bustype = dev->id.bustype;
+ id.vendor = dev->id.vendor;
+ id.product = dev->id.product;
+ id.version = dev->id.version;
+ return copy_to_user((void *) arg, &id, sizeof(struct input_devinfo));
+
case EVIOCGREP:
if ((retval = put_user(dev->rep[0], ((int *) arg) + 0))) return retval;