]> git.baikalelectronics.ru Git - kernel.git/commit
HID: uhid: allocate static minor
authorDavid Herrmann <dh.herrmann@gmail.com>
Mon, 9 Sep 2013 16:33:54 +0000 (18:33 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 26 Sep 2013 09:03:29 +0000 (11:03 +0200)
commiteecdafdd7b8800938e405393074e6b98fc4a4dc9
tree7f83152f8b341304cf4134fe85ab50d349d15ab1
parentfb4a8f016261236f09dc2d6d5c326215d6d638d0
HID: uhid: allocate static minor

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 365f79b0e993c80fe1b39a71436849d5c7e3fe85
  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>
drivers/hid/uhid.c
include/linux/miscdevice.h