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:
Kay Sievers
2009-04-30 15:23:42 +02:00
committed by Greg Kroah-Hartman
parent d405640539
commit f7a386c5b8
8 changed files with 56 additions and 2 deletions

View File

@@ -1057,8 +1057,14 @@ static const struct file_operations usblp_fops = {
.release = usblp_release,
};
static char *usblp_nodename(struct device *dev)
{
return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
}
static struct usb_class_driver usblp_class = {
.name = "lp%d",
.nodename = usblp_nodename,
.fops = &usblp_fops,
.minor_base = USBLP_MINOR_BASE,
};