Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323469
b: refs/heads/master
c: bcb4a75
h: refs/heads/master
i:
  323467: 97cbad9
v: v3
  • Loading branch information
Alexey Khoroshilov authored and Jiri Kosina committed Aug 15, 2012
1 parent 9537cf3 commit 127d925
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: 2843b673d03421e0e73cf061820d1db328f7c8eb
refs/heads/master: bcb4a75bde3821cecb17a71d287abfd6ef9bd68d
15 changes: 11 additions & 4 deletions trunk/drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,21 +559,28 @@ int __init hidraw_init(void)

if (result < 0) {
pr_warn("can't get major number\n");
result = 0;
goto out;
}

hidraw_class = class_create(THIS_MODULE, "hidraw");
if (IS_ERR(hidraw_class)) {
result = PTR_ERR(hidraw_class);
unregister_chrdev(hidraw_major, "hidraw");
goto out;
goto error_cdev;
}

cdev_init(&hidraw_cdev, &hidraw_ops);
cdev_add(&hidraw_cdev, dev_id, HIDRAW_MAX_DEVICES);
result = cdev_add(&hidraw_cdev, dev_id, HIDRAW_MAX_DEVICES);
if (result < 0)
goto error_class;

out:
return result;

error_class:
class_destroy(hidraw_class);
error_cdev:
unregister_chrdev_region(dev_id, HIDRAW_MAX_DEVICES);
goto out;
}

void hidraw_exit(void)
Expand Down

0 comments on commit 127d925

Please sign in to comment.