summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/iowarrior.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-04-30 13:23:42 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 04:30:25 (GMT)
commitf7a386c5b8ff34cd84ae922603d1c6f9d234edee (patch)
treeae1c03544dd511d85cc537c632eba6f035072e36 /drivers/usb/misc/iowarrior.c
parentd405640539555b601e52f7d18f1f0b1345d18bf5 (diff)
downloadlinux-f7a386c5b8ff34cd84ae922603d1c6f9d234edee.tar.xz
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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index a4ef77e..3c5fe5c 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -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,
};