aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 18:49:37 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 18:49:37 -0400
commitefefc6eb38d43b8e5daef482f575d767b002004e (patch)
tree8a3933db1f8721f9bcc9912c800dc8406f4bdf94 /drivers/usb/core/driver.c
parent117494a1b65183f0e3fcc817b07944bc5c465050 (diff)
parentcd59abfcc441b2abb4cf2cd62c1eb0f02a60e8dd (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (75 commits) PM: merge device power-management source files sysfs: add copyrights kobject: update the copyrights kset: add some kerneldoc to help describe what these strange things are Driver core: rename ktype_edd and ktype_efivar Driver core: rename ktype_driver Driver core: rename ktype_device Driver core: rename ktype_class driver core: remove subsystem_init() sysfs: move sysfs file poll implementation to sysfs_open_dirent sysfs: implement sysfs_open_dirent sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir sysfs: make sysfs_root a regular directory dirent sysfs: open code sysfs_attach_dentry() sysfs: make s_elem an anonymous union sysfs: make bin attr open get active reference of parent too sysfs: kill unnecessary NULL pointer check in sysfs_release() sysfs: kill unnecessary sysfs_get() in open paths sysfs: reposition sysfs_dirent->s_mode. sysfs: kill sysfs_update_file() ...
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index c27bc080d84..8586817698a 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -581,12 +581,9 @@ static int usb_device_match(struct device *dev, struct device_driver *drv)
581} 581}
582 582
583#ifdef CONFIG_HOTPLUG 583#ifdef CONFIG_HOTPLUG
584static int usb_uevent(struct device *dev, char **envp, int num_envp, 584static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
585 char *buffer, int buffer_size)
586{ 585{
587 struct usb_device *usb_dev; 586 struct usb_device *usb_dev;
588 int i = 0;
589 int length = 0;
590 587
591 if (!dev) 588 if (!dev)
592 return -ENODEV; 589 return -ENODEV;
@@ -615,51 +612,39 @@ static int usb_uevent(struct device *dev, char **envp, int num_envp,
615 * all the device descriptors we don't tell them about. Or 612 * all the device descriptors we don't tell them about. Or
616 * act as usermode drivers. 613 * act as usermode drivers.
617 */ 614 */
618 if (add_uevent_var(envp, num_envp, &i, 615 if (add_uevent_var(env, "DEVICE=/proc/bus/usb/%03d/%03d",
619 buffer, buffer_size, &length,
620 "DEVICE=/proc/bus/usb/%03d/%03d",
621 usb_dev->bus->busnum, usb_dev->devnum)) 616 usb_dev->bus->busnum, usb_dev->devnum))
622 return -ENOMEM; 617 return -ENOMEM;
623#endif 618#endif
624 619
625 /* per-device configurations are common */ 620 /* per-device configurations are common */
626 if (add_uevent_var(envp, num_envp, &i, 621 if (add_uevent_var(env, "PRODUCT=%x/%x/%x",
627 buffer, buffer_size, &length,
628 "PRODUCT=%x/%x/%x",
629 le16_to_cpu(usb_dev->descriptor.idVendor), 622 le16_to_cpu(usb_dev->descriptor.idVendor),
630 le16_to_cpu(usb_dev->descriptor.idProduct), 623 le16_to_cpu(usb_dev->descriptor.idProduct),
631 le16_to_cpu(usb_dev->descriptor.bcdDevice))) 624 le16_to_cpu(usb_dev->descriptor.bcdDevice)))
632 return -ENOMEM; 625 return -ENOMEM;
633 626
634 /* class-based driver binding models */ 627 /* class-based driver binding models */
635 if (add_uevent_var(envp, num_envp, &i, 628 if (add_uevent_var(env, "TYPE=%d/%d/%d",
636 buffer, buffer_size, &length,
637 "TYPE=%d/%d/%d",
638 usb_dev->descriptor.bDeviceClass, 629 usb_dev->descriptor.bDeviceClass,
639 usb_dev->descriptor.bDeviceSubClass, 630 usb_dev->descriptor.bDeviceSubClass,
640 usb_dev->descriptor.bDeviceProtocol)) 631 usb_dev->descriptor.bDeviceProtocol))
641 return -ENOMEM; 632 return -ENOMEM;
642 633
643 if (add_uevent_var(envp, num_envp, &i, 634 if (add_uevent_var(env, "BUSNUM=%03d",
644 buffer, buffer_size, &length,
645 "BUSNUM=%03d",
646 usb_dev->bus->busnum)) 635 usb_dev->bus->busnum))
647 return -ENOMEM; 636 return -ENOMEM;
648 637
649 if (add_uevent_var(envp, num_envp, &i, 638 if (add_uevent_var(env, "DEVNUM=%03d",
650 buffer, buffer_size, &length,
651 "DEVNUM=%03d",
652 usb_dev->devnum)) 639 usb_dev->devnum))
653 return -ENOMEM; 640 return -ENOMEM;
654 641
655 envp[i] = NULL;
656 return 0; 642 return 0;
657} 643}
658 644
659#else 645#else
660 646
661static int usb_uevent(struct device *dev, char **envp, 647static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
662 int num_envp, char *buffer, int buffer_size)
663{ 648{
664 return -ENODEV; 649 return -ENODEV;
665} 650}