aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2008-07-23 09:19:00 -0400
committerJiri Kosina <jkosina@suse.cz>2008-07-23 09:19:00 -0400
commit9063974cdbc5463528cb6aa60c91bc0267af7bbb (patch)
tree1dffc62d8b79b3d89459cf23aa59c553e186840a /drivers/hid
parentd6d6a86e14a6b5a26c785b45268874a8f7a52b4d (diff)
parentc010b2f76c3032e48097a6eef291d8593d5d79a6 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hidraw.c8
-rw-r--r--drivers/hid/usbhid/hid-core.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 1ca6f4635eeb..0c6b4d4e7e27 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -30,6 +30,7 @@
30#include <linux/major.h> 30#include <linux/major.h>
31#include <linux/hid.h> 31#include <linux/hid.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33#include <linux/smp_lock.h>
33 34
34#include <linux/hidraw.h> 35#include <linux/hidraw.h>
35 36
@@ -157,6 +158,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
157 struct hidraw_list *list; 158 struct hidraw_list *list;
158 int err = 0; 159 int err = 0;
159 160
161 lock_kernel();
160 if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) { 162 if (!(list = kzalloc(sizeof(struct hidraw_list), GFP_KERNEL))) {
161 err = -ENOMEM; 163 err = -ENOMEM;
162 goto out; 164 goto out;
@@ -183,6 +185,7 @@ static int hidraw_open(struct inode *inode, struct file *file)
183out_unlock: 185out_unlock:
184 spin_unlock(&minors_lock); 186 spin_unlock(&minors_lock);
185out: 187out:
188 unlock_kernel();
186 return err; 189 return err;
187 190
188} 191}
@@ -319,8 +322,9 @@ int hidraw_connect(struct hid_device *hid)
319 goto out; 322 goto out;
320 } 323 }
321 324
322 dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor), 325 dev->dev = device_create_drvdata(hidraw_class, NULL,
323 "%s%d", "hidraw", minor); 326 MKDEV(hidraw_major, minor), NULL,
327 "%s%d", "hidraw", minor);
324 328
325 if (IS_ERR(dev->dev)) { 329 if (IS_ERR(dev->dev)) {
326 spin_lock(&minors_lock); 330 spin_lock(&minors_lock);
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 01427c51c7cc..27fe4d8912cb 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -122,7 +122,7 @@ static void hid_reset(struct work_struct *work)
122 dev_dbg(&usbhid->intf->dev, "resetting device\n"); 122 dev_dbg(&usbhid->intf->dev, "resetting device\n");
123 rc = rc_lock = usb_lock_device_for_reset(hid_to_usb_dev(hid), usbhid->intf); 123 rc = rc_lock = usb_lock_device_for_reset(hid_to_usb_dev(hid), usbhid->intf);
124 if (rc_lock >= 0) { 124 if (rc_lock >= 0) {
125 rc = usb_reset_composite_device(hid_to_usb_dev(hid), usbhid->intf); 125 rc = usb_reset_device(hid_to_usb_dev(hid));
126 if (rc_lock) 126 if (rc_lock)
127 usb_unlock_device(hid_to_usb_dev(hid)); 127 usb_unlock_device(hid_to_usb_dev(hid));
128 } 128 }