aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r--drivers/hid/usbhid/hid-core.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 74b817d7968d..3a9563195850 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -32,6 +32,7 @@
32#include <linux/hid.h> 32#include <linux/hid.h>
33#include <linux/hiddev.h> 33#include <linux/hiddev.h>
34#include <linux/hid-debug.h> 34#include <linux/hid-debug.h>
35#include <linux/hidraw.h>
35#include "usbhid.h" 36#include "usbhid.h"
36 37
37/* 38/*
@@ -932,6 +933,8 @@ static void hid_disconnect(struct usb_interface *intf)
932 hidinput_disconnect(hid); 933 hidinput_disconnect(hid);
933 if (hid->claimed & HID_CLAIMED_HIDDEV) 934 if (hid->claimed & HID_CLAIMED_HIDDEV)
934 hiddev_disconnect(hid); 935 hiddev_disconnect(hid);
936 if (hid->claimed & HID_CLAIMED_HIDRAW)
937 hidraw_disconnect(hid);
935 938
936 usb_free_urb(usbhid->urbin); 939 usb_free_urb(usbhid->urbin);
937 usb_free_urb(usbhid->urbctrl); 940 usb_free_urb(usbhid->urbctrl);
@@ -964,11 +967,13 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
964 hid->claimed |= HID_CLAIMED_INPUT; 967 hid->claimed |= HID_CLAIMED_INPUT;
965 if (!hiddev_connect(hid)) 968 if (!hiddev_connect(hid))
966 hid->claimed |= HID_CLAIMED_HIDDEV; 969 hid->claimed |= HID_CLAIMED_HIDDEV;
970 if (!hidraw_connect(hid))
971 hid->claimed |= HID_CLAIMED_HIDRAW;
967 972
968 usb_set_intfdata(intf, hid); 973 usb_set_intfdata(intf, hid);
969 974
970 if (!hid->claimed) { 975 if (!hid->claimed) {
971 printk ("HID device not claimed by input or hiddev\n"); 976 printk ("HID device claimed by neither input, hiddev nor hidraw\n");
972 hid_disconnect(intf); 977 hid_disconnect(intf);
973 return -ENODEV; 978 return -ENODEV;
974 } 979 }
@@ -984,10 +989,16 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
984 989
985 if (hid->claimed & HID_CLAIMED_INPUT) 990 if (hid->claimed & HID_CLAIMED_INPUT)
986 printk("input"); 991 printk("input");
987 if (hid->claimed == (HID_CLAIMED_INPUT | HID_CLAIMED_HIDDEV)) 992 if ((hid->claimed & HID_CLAIMED_INPUT) && ((hid->claimed & HID_CLAIMED_HIDDEV) ||
993 hid->claimed & HID_CLAIMED_HIDRAW))
988 printk(","); 994 printk(",");
989 if (hid->claimed & HID_CLAIMED_HIDDEV) 995 if (hid->claimed & HID_CLAIMED_HIDDEV)
990 printk("hiddev%d", hid->minor); 996 printk("hiddev%d", hid->minor);
997 if ((hid->claimed & HID_CLAIMED_INPUT) && (hid->claimed & HID_CLAIMED_HIDDEV) &&
998 (hid->claimed & HID_CLAIMED_HIDRAW))
999 printk(",");
1000 if (hid->claimed & HID_CLAIMED_HIDRAW)
1001 printk("hidraw%d", ((struct hidraw*)hid->hidraw)->minor);
991 1002
992 c = "Device"; 1003 c = "Device";
993 for (i = 0; i < hid->maxcollection; i++) { 1004 for (i = 0; i < hid->maxcollection; i++) {