Commit 434a25d4 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: Don't access input_dev->private directly
  HID: fix hidinput_connect ignoring retval from input_register_device
  HID: hiddev - fix compiler warning
  HID: Add GoTop tablets to blacklist
parents 3ce4af1d f202df60
...@@ -297,7 +297,7 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid, ...@@ -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, static int hidinput_getkeycode(struct input_dev *dev, int scancode,
int *keycode) int *keycode)
{ {
struct hid_device *hid = dev->private; struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage; struct hid_usage *usage;
usage = hidinput_find_key(hid, scancode, 0); usage = hidinput_find_key(hid, scancode, 0);
...@@ -311,7 +311,7 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode, ...@@ -311,7 +311,7 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode,
static int hidinput_setkeycode(struct input_dev *dev, int scancode, static int hidinput_setkeycode(struct input_dev *dev, int scancode,
int keycode) int keycode)
{ {
struct hid_device *hid = dev->private; struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage; struct hid_usage *usage;
int old_keycode; int old_keycode;
...@@ -1152,7 +1152,7 @@ int hidinput_connect(struct hid_device *hid) ...@@ -1152,7 +1152,7 @@ int hidinput_connect(struct hid_device *hid)
kfree(hidinput); kfree(hidinput);
input_free_device(input_dev); input_free_device(input_dev);
err_hid("Out of memory during hid input probe"); err_hid("Out of memory during hid input probe");
return -1; goto out_unwind;
} }
input_set_drvdata(input_dev, hid); input_set_drvdata(input_dev, hid);
...@@ -1186,15 +1186,25 @@ int hidinput_connect(struct hid_device *hid) ...@@ -1186,15 +1186,25 @@ int hidinput_connect(struct hid_device *hid)
* UGCI) cram a lot of unrelated inputs into the * UGCI) cram a lot of unrelated inputs into the
* same interface. */ * same interface. */
hidinput->report = report; hidinput->report = report;
input_register_device(hidinput->input); if (input_register_device(hidinput->input))
goto out_cleanup;
hidinput = NULL; hidinput = NULL;
} }
} }
if (hidinput) if (hidinput && input_register_device(hidinput->input))
input_register_device(hidinput->input); goto out_cleanup;
return 0; 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); EXPORT_SYMBOL_GPL(hidinput_connect);
......
...@@ -129,6 +129,11 @@ ...@@ -129,6 +129,11 @@
#define USB_DEVICE_ID_0_8_8_IF_KIT 0x0053 #define USB_DEVICE_ID_0_8_8_IF_KIT 0x0053
#define USB_DEVICE_ID_PHIDGET_MOTORCONTROL 0x0058 #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_VENDOR_ID_GRIFFIN 0x077d
#define USB_DEVICE_ID_POWERMATE 0x0410 #define USB_DEVICE_ID_POWERMATE 0x0410
#define USB_DEVICE_ID_SOUNDKNOB 0x04AA #define USB_DEVICE_ID_SOUNDKNOB 0x04AA
...@@ -415,6 +420,9 @@ static const struct hid_blacklist { ...@@ -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_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_0_8_8_IF_KIT, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_PHIDGET_MOTORCONTROL, 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_POWERMATE, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, 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 }, { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_90, HID_QUIRK_IGNORE },
......
...@@ -743,7 +743,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd ...@@ -743,7 +743,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
struct inode *inode = file->f_path.dentry->d_inode; 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 #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment