Skip to content
  • David Herrmann's avatar
    HID: uhid: allocate static minor · 0e01faab
    David Herrmann authored
    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 578454ff
    
    
      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: default avatarTom Gundersen <teg@jklm.no>
    Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    0e01faab