diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-input.c | 22 | ||||
-rw-r--r-- | drivers/hid/hidraw.c | 4 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-ff.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 8 | ||||
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbkbd.c | 7 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbmouse.c | 12 |
7 files changed, 39 insertions, 18 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index dd332f28e08..0b27da7d749 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -297,7 +297,7 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid, static int hidinput_getkeycode(struct input_dev *dev, int scancode, int *keycode) { - struct hid_device *hid = dev->private; + struct hid_device *hid = input_get_drvdata(dev); struct hid_usage *usage; usage = hidinput_find_key(hid, scancode, 0); @@ -311,7 +311,7 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode, static int hidinput_setkeycode(struct input_dev *dev, int scancode, int keycode) { - struct hid_device *hid = dev->private; + struct hid_device *hid = input_get_drvdata(dev); struct hid_usage *usage; int old_keycode; @@ -1152,7 +1152,7 @@ int hidinput_connect(struct hid_device *hid) kfree(hidinput); input_free_device(input_dev); err_hid("Out of memory during hid input probe"); - return -1; + goto out_unwind; } input_set_drvdata(input_dev, hid); @@ -1186,15 +1186,25 @@ int hidinput_connect(struct hid_device *hid) * UGCI) cram a lot of unrelated inputs into the * same interface. */ hidinput->report = report; - input_register_device(hidinput->input); + if (input_register_device(hidinput->input)) + goto out_cleanup; hidinput = NULL; } } - if (hidinput) - input_register_device(hidinput->input); + if (hidinput && input_register_device(hidinput->input)) + goto out_cleanup; return 0; + +out_cleanup: + input_free_device(hidinput->input); + kfree(hidinput); +out_unwind: + /* unwind the ones we already registered */ + hidinput_disconnect(hid); + + return -1; } EXPORT_SYMBOL_GPL(hidinput_connect); diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index a702e2f6da7..1ca6f4635ee 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -113,13 +113,13 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t if (count > HID_MIN_BUFFER_SIZE) { printk(KERN_WARNING "hidraw: pid %d passed too large report\n", - current->pid); + task_pid_nr(current)); return -EINVAL; } if (count < 2) { printk(KERN_WARNING "hidraw: pid %d passed too short report\n", - current->pid); + task_pid_nr(current)); return -EINVAL; } diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c index 22329feb3b5..4c210e16b1b 100644 --- a/drivers/hid/usbhid/hid-ff.c +++ b/drivers/hid/usbhid/hid-ff.c @@ -1,6 +1,4 @@ /* - * $Id: hid-ff.c,v 1.2 2002/04/18 22:02:47 jdeneux Exp $ - * * Force feedback support for hid devices. * Not all hid devices use the same protocol. For example, some use PID, * other use their own proprietary procotol. diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 41a59a80e7e..a2552856476 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -129,6 +129,11 @@ #define USB_DEVICE_ID_0_8_8_IF_KIT 0x0053 #define USB_DEVICE_ID_PHIDGET_MOTORCONTROL 0x0058 +#define USB_VENDOR_ID_GOTOP 0x08f2 +#define USB_DEVICE_ID_SUPER_Q2 0x007f +#define USB_DEVICE_ID_GOGOPEN 0x00ce +#define USB_DEVICE_ID_PENPOWER 0x00f4 + #define USB_VENDOR_ID_GRIFFIN 0x077d #define USB_DEVICE_ID_POWERMATE 0x0410 #define USB_DEVICE_ID_SOUNDKNOB 0x04AA @@ -415,6 +420,9 @@ static const struct hid_blacklist { { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_7_IF_KIT, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_PHIDGET_MOTORCONTROL, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_90, HID_QUIRK_IGNORE }, diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 9837adcb17e..5fc4019956b 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c @@ -743,7 +743,7 @@ inval: static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct inode *inode = file->f_path.dentry->d_inode; - return hiddev_ioctl(inode, file, cmd, compat_ptr(arg)); + return hiddev_ioctl(inode, file, cmd, (unsigned long)compat_ptr(arg)); } #endif diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index b76b02f7b52..775a1ef28a2 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -274,8 +274,11 @@ static int usb_kbd_probe(struct usb_interface *iface, input_set_drvdata(input_dev, kbd); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); - input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL) | BIT(LED_COMPOSE) | BIT(LED_KANA); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) | + BIT_MASK(EV_REP); + input_dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) | + BIT_MASK(LED_SCROLLL) | BIT_MASK(LED_COMPOSE) | + BIT_MASK(LED_KANA); for (i = 0; i < 255; i++) set_bit(usb_kbd_keycode[i], input_dev->keybit); diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 5345c73bcf6..f8ad6910d3d 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c @@ -173,11 +173,13 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i usb_to_input_id(dev, &input_dev->id); input_dev->dev.parent = &intf->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); - input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA); - input_dev->relbit[0] |= BIT(REL_WHEEL); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); + input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_SIDE) | + BIT_MASK(BTN_EXTRA); + input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); input_set_drvdata(input_dev, mouse); |