mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-05-02 18:15:03 -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 <kay.sievers@vrfy.org> Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d405640539
commit
f7a386c5b8
@@ -726,12 +726,18 @@ static const struct file_operations iowarrior_fops = {
|
||||
.poll = iowarrior_poll,
|
||||
};
|
||||
|
||||
static char *iowarrior_nodename(struct device *dev)
|
||||
{
|
||||
return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
|
||||
}
|
||||
|
||||
/*
|
||||
* usb class driver info in order to get a minor number from the usb core,
|
||||
* and to have the device registered with devfs and the driver core
|
||||
*/
|
||||
static struct usb_class_driver iowarrior_class = {
|
||||
.name = "iowarrior%d",
|
||||
.nodename = iowarrior_nodename,
|
||||
.fops = &iowarrior_fops,
|
||||
.minor_base = IOWARRIOR_MINOR_BASE,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user