]> err.no Git - linux-2.6/blobdiff - drivers/hid/hid-core.c
HID: proper LED-mapping for SpaceNavigator
[linux-2.6] / drivers / hid / hid-core.c
index f143c35227fa36258b4233d57de086580a533fef..38db8321b211887f4ce86e842e0823bc294a1207 100644 (file)
@@ -40,7 +40,7 @@
 
 #define DRIVER_VERSION "v2.6"
 #define DRIVER_AUTHOR "Andreas Gal, Vojtech Pavlik"
-#define DRIVER_DESC "USB HID core driver"
+#define DRIVER_DESC "HID core driver"
 #define DRIVER_LICENSE "GPL"
 
 /*
@@ -880,6 +880,10 @@ static void hid_output_field(struct hid_field *field, __u8 *data)
        unsigned size = field->report_size;
        unsigned n;
 
+       /* make sure the unused bits in the last byte are zeros */
+       if (count > 0 && size > 0)
+               data[(count*size-1)/8] = 0;
+
        for (n = 0; n < count; n++) {
                if (field->logical_minimum < 0) /* signed values */
                        implement(data, offset + n * size, size, s32ton(field->value[n], size));