aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r--drivers/usb/core/usb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 7eee400d3e3..927a27dd2f8 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -305,10 +305,21 @@ static struct dev_pm_ops usb_device_pm_ops = {
305 305
306#endif /* CONFIG_PM */ 306#endif /* CONFIG_PM */
307 307
308
309static char *usb_nodename(struct device *dev)
310{
311 struct usb_device *usb_dev;
312
313 usb_dev = to_usb_device(dev);
314 return kasprintf(GFP_KERNEL, "bus/usb/%03d/%03d",
315 usb_dev->bus->busnum, usb_dev->devnum);
316}
317
308struct device_type usb_device_type = { 318struct device_type usb_device_type = {
309 .name = "usb_device", 319 .name = "usb_device",
310 .release = usb_release_dev, 320 .release = usb_release_dev,
311 .uevent = usb_dev_uevent, 321 .uevent = usb_dev_uevent,
322 .nodename = usb_nodename,
312 .pm = &usb_device_pm_ops, 323 .pm = &usb_device_pm_ops,
313}; 324};
314 325