From 7d30d1df118d5b27a559e590475897e1b09f0ebe Mon Sep 17 00:00:00 2001 From: Vojtech Pavlik Date: Thu, 25 Jul 2002 02:57:12 +0200 Subject: 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. --- drivers/input/evdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/input/evdev.c') 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; -- cgit v1.2.3