1USB_REGISTER_DEV(9)              USB Core APIs             USB_REGISTER_DEV(9)
2
3
4

NAME

6       usb_register_dev - register a USB device, and ask for a minor number
7

SYNOPSIS

9       int usb_register_dev(struct usb_interface * intf,
10                            struct usb_class_driver * class_driver);
11

ARGUMENTS

13       intf
14           pointer to the usb_interface that is being registered
15
16       class_driver
17           pointer to the usb_class_driver for this device
18

DESCRIPTION

20       This should be called by all USB drivers that use the USB major number.
21       If CONFIG_USB_DYNAMIC_MINORS is enabled, the minor number will be
22       dynamically allocated out of the list of available ones. If it is not
23       enabled, the minor number will be based on the next available free
24       minor, starting at the class_driver->minor_base.
25
26       This function also creates a usb class device in the sysfs tree.
27
28       usb_deregister_dev must be called when the driver is done with the
29       minor numbers given out by this function.
30

RETURN

32       -EINVAL if something bad happens with trying to register a device, and
33       0 on success.
34
36Kernel Hackers Manual 3.10         June 2019               USB_REGISTER_DEV(9)
Impressum