diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-09-09 18:33:54 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-13 16:08:35 -0700 |
commit | 0e01faab5690ff1674f659abb5ef719be6ef549d (patch) | |
tree | e5b0d92338f2eb3a1f20b034a930b09838eee75e /drivers/hid | |
parent | 1685c9903b259801b4e1c6c0c325f364742f28f4 (diff) | |
download | linux-3.10-0e01faab5690ff1674f659abb5ef719be6ef549d.tar.gz linux-3.10-0e01faab5690ff1674f659abb5ef719be6ef549d.tar.bz2 linux-3.10-0e01faab5690ff1674f659abb5ef719be6ef549d.zip |
HID: uhid: allocate static minor
commit 19872d20c890073c5207d9e02bb8f14d451a11eb upstream.
udev has this nice feature of creating "dead" /dev/<node> device-nodes if
it finds a devnode:<node> modalias. Once the node is accessed, the kernel
automatically loads the module that provides the node. However, this
requires udev to know the major:minor code to use for the node. This
feature was introduced by:
commit 578454ff7eab61d13a26b568f99a89a2c9edc881
Author: Kay Sievers <kay.sievers@vrfy.org>
Date: Thu May 20 18:07:20 2010 +0200
driver core: add devname module aliases to allow module on-demand auto-loading
However, uhid uses dynamic minor numbers so this doesn't actually work. We
need to load uhid to know which minor it's going to use.
Hence, allocate a static minor (just like uinput does) and we're good
to go.
Reported-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/uhid.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 9ab7dfc6c72..145a4cb5c87 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -640,7 +640,7 @@ static const struct file_operations uhid_fops = { static struct miscdevice uhid_misc = { .fops = &uhid_fops, - .minor = MISC_DYNAMIC_MINOR, + .minor = UHID_MINOR, .name = UHID_NAME, }; @@ -659,4 +659,5 @@ module_exit(uhid_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("David Herrmann <dh.herrmann@gmail.com>"); MODULE_DESCRIPTION("User-space I/O driver support for HID subsystem"); +MODULE_ALIAS_MISCDEV(UHID_MINOR); MODULE_ALIAS("devname:" UHID_NAME); |