]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB HID: Fix USB vendor and product IDs endianness for USB HID devices
authorJulien BLACHE <jb@jblache.org>
Sun, 11 Feb 2007 17:20:25 +0000 (18:20 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 1 Mar 2007 08:52:37 +0000 (09:52 +0100)
The USB vendor and product IDs are not byteswapped appropriately, and
thus come out in the wrong endianness when fetched through the evdev
using ioctl() on big endian platforms.

Signed-off-by: Julien BLACHE <jb@jblache.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/usb/input/hid-core.c

index ef09952f20393aea387a031be84b45f3fcc6f99f..905156c52ad3d14403216a812d011f0e1fe94f71 100644 (file)
@@ -1225,8 +1225,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
                         le16_to_cpu(dev->descriptor.idProduct));
 
        hid->bus = BUS_USB;
-       hid->vendor = dev->descriptor.idVendor;
-       hid->product = dev->descriptor.idProduct;
+       hid->vendor = le16_to_cpu(dev->descriptor.idVendor);
+       hid->product = le16_to_cpu(dev->descriptor.idProduct);
 
        usb_make_path(dev, hid->phys, sizeof(hid->phys));
        strlcat(hid->phys, "/input", sizeof(hid->phys));