Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273330
b: refs/heads/master
c: 8052ee5
h: refs/heads/master
v: v3
  • Loading branch information
Julia Lawall authored and Jiri Kosina committed Nov 1, 2011
1 parent 7a4884a commit 0702cf5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad734bc1565364f9e4b70888d3ce5743b3c1030a
refs/heads/master: 8052ee5f5fd9be153129eaa06ced4a786415abc1
18 changes: 9 additions & 9 deletions trunk/drivers/hid/hid-roccat.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,27 @@ static int roccat_open(struct inode *inode, struct file *file)

device = devices[minor];

mutex_lock(&device->readers_lock);

if (!device) {
pr_emerg("roccat device with minor %d doesn't exist\n", minor);
error = -ENODEV;
goto exit_err;
goto exit_err_devices;
}

mutex_lock(&device->readers_lock);

if (!device->open++) {
/* power on device on adding first reader */
error = hid_hw_power(device->hid, PM_HINT_FULLON);
if (error < 0) {
--device->open;
goto exit_err;
goto exit_err_readers;
}

error = hid_hw_open(device->hid);
if (error < 0) {
hid_hw_power(device->hid, PM_HINT_NORMAL);
--device->open;
goto exit_err;
goto exit_err_readers;
}
}

Expand All @@ -193,13 +193,13 @@ static int roccat_open(struct inode *inode, struct file *file)
list_add_tail(&reader->node, &device->readers);
file->private_data = reader;

exit_unlock:
exit_err_readers:
mutex_unlock(&device->readers_lock);
exit_err_devices:
mutex_unlock(&devices_lock);
if (error)
kfree(reader);
return error;
exit_err:
kfree(reader);
goto exit_unlock;
}

static int roccat_release(struct inode *inode, struct file *file)
Expand Down

0 comments on commit 0702cf5

Please sign in to comment.