@@ -270,17 +270,26 @@ static int hiddev_open(struct inode *inode, struct file *file)
struct hiddev *hiddev;
int res;
+ printk("A\n");
intf = usbhid_find_interface(iminor(inode));
+ printk("B\n");
if (!intf)
return -ENODEV;
+ printk("C\n");
hid = usb_get_intfdata(intf);
+ printk("D\n");
hiddev = hid->hiddev;
+ printk("E\n");
if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL)))
return -ENOMEM;
+ printk("F\n");
mutex_init(&list->thread_lock);
+ printk("G\n");
list->hiddev = hiddev;
+ printk("H\n");
file->private_data = list;
+ printk("I\n");
/*
* no need for locking because the USB major number
@@ -298,11 +307,14 @@ static int hiddev_open(struct inode *inode, struct file *file)
res = -ENODEV;
goto bail;
}
+ printk("J\n");
spin_lock_irq(&list->hiddev->list_lock);
list_add_tail(&list->node, &hiddev->list);
spin_unlock_irq(&list->hiddev->list_lock);
+ printk("K\n");
+
if (!list->hiddev->open++)
if (list->hiddev->exist) {
struct hid_device *hid = hiddev->hid;
@@ -313,10 +325,13 @@ static int hiddev_open(struct inode *inode, struct file *file)
}
usbhid_open(hid);
}
+ printk("L\n");
return 0;
bail:
+ printk("M\n");
file->private_data = NULL;
kfree(list);
+ printk("N\n");
return res;
}