diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-04-30 09:23:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:25 -0400 |
commit | f7a386c5b8ff34cd84ae922603d1c6f9d234edee (patch) | |
tree | ae1c03544dd511d85cc537c632eba6f035072e36 /drivers/usb/misc/iowarrior.c | |
parent | d405640539555b601e52f7d18f1f0b1345d18bf5 (diff) |
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>
Diffstat (limited to 'drivers/usb/misc/iowarrior.c')
-rw-r--r-- | drivers/usb/misc/iowarrior.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index a4ef77ef917d..3c5fe5cee05a 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c | |||
@@ -726,12 +726,18 @@ static const struct file_operations iowarrior_fops = { | |||
726 | .poll = iowarrior_poll, | 726 | .poll = iowarrior_poll, |
727 | }; | 727 | }; |
728 | 728 | ||
729 | static char *iowarrior_nodename(struct device *dev) | ||
730 | { | ||
731 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | ||
732 | } | ||
733 | |||
729 | /* | 734 | /* |
730 | * usb class driver info in order to get a minor number from the usb core, | 735 | * usb class driver info in order to get a minor number from the usb core, |
731 | * and to have the device registered with devfs and the driver core | 736 | * and to have the device registered with devfs and the driver core |
732 | */ | 737 | */ |
733 | static struct usb_class_driver iowarrior_class = { | 738 | static struct usb_class_driver iowarrior_class = { |
734 | .name = "iowarrior%d", | 739 | .name = "iowarrior%d", |
740 | .nodename = iowarrior_nodename, | ||
735 | .fops = &iowarrior_fops, | 741 | .fops = &iowarrior_fops, |
736 | .minor_base = IOWARRIOR_MINOR_BASE, | 742 | .minor_base = IOWARRIOR_MINOR_BASE, |
737 | }; | 743 | }; |