Skip to contentSkip to conversation

hiddev: Clarify minor device numbering

PATCH New Thomas Guyot-Sionnest 1 participant 1 message Mar 7, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hiddev: Clarify minor device numbering

USB hiddev minor device numbering can be dynamic, in which case the minor be any number from 0 to 255. This is defined in drivers/hid/usbhid/hiddev.c.

---
 Documentation/hid/hiddev.rst | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/hid/hiddev.rst +7 -0
index caebc6266603..9647210cdd34 100644
@@ -54,6 +54,13 @@ you need the following commands::
 	mknod /dev/usb/hiddev14 c 180 110
 	mknod /dev/usb/hiddev15 c 180 111
 
+When using CONFIG_USB_DYNAMIC_MINORS you should let udev create these
+devices automatically. They will have a minor ranging from 0 to 255.
+You can find the actual major:minor in the /sys tree under the usbmisc
+class. You can list them with::
+
+  grep -H . /sys/class/usbmisc/hiddev*/dev
+
 So you point your hiddev compliant user-space program at the correct
 interface for your device, and it all just works.
 
Signature · 1 line
2.30.2