aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat.c
diff options
context:
space:
mode:
authorStefan Achatz <erazor_de@users.sourceforge.net>2011-01-30 07:38:30 -0500
committerJiri Kosina <jkosina@suse.cz>2011-02-03 10:37:28 -0500
commite6fa47af5542df3383a78d7cc78f5d5ef63c0d42 (patch)
tree61ad2667932aeaec1c1572e4f099ba507eb49e33 /drivers/hid/hid-roccat.c
parent74b643dac475e29f53f4132d2349ec1dba3c9e44 (diff)
HID: roccat: Fix bug that prevented roccat chardev from removing devices
pointer to device was cleared too early. This is fixed now. Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat.c')
-rw-r--r--drivers/hid/hid-roccat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
index 0fa23dead5e1..bbe294c0dd9b 100644
--- a/drivers/hid/hid-roccat.c
+++ b/drivers/hid/hid-roccat.c
@@ -356,13 +356,16 @@ void roccat_disconnect(int minor)
356 356
357 mutex_lock(&devices_lock); 357 mutex_lock(&devices_lock);
358 device = devices[minor]; 358 device = devices[minor];
359 devices[minor] = NULL;
360 mutex_unlock(&devices_lock); 359 mutex_unlock(&devices_lock);
361 360
362 device->exist = 0; /* TODO exist maybe not needed */ 361 device->exist = 0; /* TODO exist maybe not needed */
363 362
364 device_destroy(device->dev->class, MKDEV(roccat_major, minor)); 363 device_destroy(device->dev->class, MKDEV(roccat_major, minor));
365 364
365 mutex_lock(&devices_lock);
366 devices[minor] = NULL;
367 mutex_unlock(&devices_lock);
368
366 if (device->open) { 369 if (device->open) {
367 hid_hw_close(device->hid); 370 hid_hw_close(device->hid);
368 wake_up_interruptible(&device->wait); 371 wake_up_interruptible(&device->wait);