mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Driver Core: usb: add nodename support for usb drivers.
This adds support for USB drivers to report their requested nodename to userspace. It also updates a number of USB drivers to provide the needed subdirectory and device name to be used for them. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Jan Blunck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
d405640539
commit
f7a386c5b8
8 changed files with 56 additions and 2 deletions
|
|
@ -850,8 +850,14 @@ static const struct file_operations hiddev_fops = {
|
|||
#endif
|
||||
};
|
||||
|
||||
static char *hiddev_nodename(struct device *dev)
|
||||
{
|
||||
return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
|
||||
}
|
||||
|
||||
static struct usb_class_driver hiddev_class = {
|
||||
.name = "hiddev%d",
|
||||
.nodename = hiddev_nodename,
|
||||
.fops = &hiddev_fops,
|
||||
.minor_base = HIDDEV_MINOR_BASE,
|
||||
};
|
||||
|
|
@ -955,7 +961,6 @@ static int hiddev_usbd_probe(struct usb_interface *intf,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
||||
static /* const */ struct usb_driver hiddev_driver = {
|
||||
.name = "hiddev",
|
||||
.probe = hiddev_usbd_probe,
|
||||
|
|
|
|||
Loading…
Reference in a new issue