diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-12 18:49:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-12 18:49:37 -0400 |
commit | efefc6eb38d43b8e5daef482f575d767b002004e (patch) | |
tree | 8a3933db1f8721f9bcc9912c800dc8406f4bdf94 /drivers/usb/core/message.c | |
parent | 117494a1b65183f0e3fcc817b07944bc5c465050 (diff) | |
parent | cd59abfcc441b2abb4cf2cd62c1eb0f02a60e8dd (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/message.c')
-rw-r--r-- | drivers/usb/core/message.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 98fcddba690..c021af39037 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1344,14 +1344,11 @@ static void usb_release_interface(struct device *dev) | |||
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | #ifdef CONFIG_HOTPLUG | 1346 | #ifdef CONFIG_HOTPLUG |
1347 | static int usb_if_uevent(struct device *dev, char **envp, int num_envp, | 1347 | static int usb_if_uevent(struct device *dev, struct kobj_uevent_env *env) |
1348 | char *buffer, int buffer_size) | ||
1349 | { | 1348 | { |
1350 | struct usb_device *usb_dev; | 1349 | struct usb_device *usb_dev; |
1351 | struct usb_interface *intf; | 1350 | struct usb_interface *intf; |
1352 | struct usb_host_interface *alt; | 1351 | struct usb_host_interface *alt; |
1353 | int i = 0; | ||
1354 | int length = 0; | ||
1355 | 1352 | ||
1356 | if (!dev) | 1353 | if (!dev) |
1357 | return -ENODEV; | 1354 | return -ENODEV; |
@@ -1364,39 +1361,30 @@ static int usb_if_uevent(struct device *dev, char **envp, int num_envp, | |||
1364 | alt = intf->cur_altsetting; | 1361 | alt = intf->cur_altsetting; |
1365 | 1362 | ||
1366 | #ifdef CONFIG_USB_DEVICEFS | 1363 | #ifdef CONFIG_USB_DEVICEFS |
1367 | if (add_uevent_var(envp, num_envp, &i, | 1364 | if (add_uevent_var(env, "DEVICE=/proc/bus/usb/%03d/%03d", |
1368 | buffer, buffer_size, &length, | ||
1369 | "DEVICE=/proc/bus/usb/%03d/%03d", | ||
1370 | usb_dev->bus->busnum, usb_dev->devnum)) | 1365 | usb_dev->bus->busnum, usb_dev->devnum)) |
1371 | return -ENOMEM; | 1366 | return -ENOMEM; |
1372 | #endif | 1367 | #endif |
1373 | 1368 | ||
1374 | if (add_uevent_var(envp, num_envp, &i, | 1369 | if (add_uevent_var(env, "PRODUCT=%x/%x/%x", |
1375 | buffer, buffer_size, &length, | ||
1376 | "PRODUCT=%x/%x/%x", | ||
1377 | le16_to_cpu(usb_dev->descriptor.idVendor), | 1370 | le16_to_cpu(usb_dev->descriptor.idVendor), |
1378 | le16_to_cpu(usb_dev->descriptor.idProduct), | 1371 | le16_to_cpu(usb_dev->descriptor.idProduct), |
1379 | le16_to_cpu(usb_dev->descriptor.bcdDevice))) | 1372 | le16_to_cpu(usb_dev->descriptor.bcdDevice))) |
1380 | return -ENOMEM; | 1373 | return -ENOMEM; |
1381 | 1374 | ||
1382 | if (add_uevent_var(envp, num_envp, &i, | 1375 | if (add_uevent_var(env, "TYPE=%d/%d/%d", |
1383 | buffer, buffer_size, &length, | ||
1384 | "TYPE=%d/%d/%d", | ||
1385 | usb_dev->descriptor.bDeviceClass, | 1376 | usb_dev->descriptor.bDeviceClass, |
1386 | usb_dev->descriptor.bDeviceSubClass, | 1377 | usb_dev->descriptor.bDeviceSubClass, |
1387 | usb_dev->descriptor.bDeviceProtocol)) | 1378 | usb_dev->descriptor.bDeviceProtocol)) |
1388 | return -ENOMEM; | 1379 | return -ENOMEM; |
1389 | 1380 | ||
1390 | if (add_uevent_var(envp, num_envp, &i, | 1381 | if (add_uevent_var(env, "INTERFACE=%d/%d/%d", |
1391 | buffer, buffer_size, &length, | ||
1392 | "INTERFACE=%d/%d/%d", | ||
1393 | alt->desc.bInterfaceClass, | 1382 | alt->desc.bInterfaceClass, |
1394 | alt->desc.bInterfaceSubClass, | 1383 | alt->desc.bInterfaceSubClass, |
1395 | alt->desc.bInterfaceProtocol)) | 1384 | alt->desc.bInterfaceProtocol)) |
1396 | return -ENOMEM; | 1385 | return -ENOMEM; |
1397 | 1386 | ||
1398 | if (add_uevent_var(envp, num_envp, &i, | 1387 | if (add_uevent_var(env, |
1399 | buffer, buffer_size, &length, | ||
1400 | "MODALIAS=usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X", | 1388 | "MODALIAS=usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X", |
1401 | le16_to_cpu(usb_dev->descriptor.idVendor), | 1389 | le16_to_cpu(usb_dev->descriptor.idVendor), |
1402 | le16_to_cpu(usb_dev->descriptor.idProduct), | 1390 | le16_to_cpu(usb_dev->descriptor.idProduct), |
@@ -1409,14 +1397,12 @@ static int usb_if_uevent(struct device *dev, char **envp, int num_envp, | |||
1409 | alt->desc.bInterfaceProtocol)) | 1397 | alt->desc.bInterfaceProtocol)) |
1410 | return -ENOMEM; | 1398 | return -ENOMEM; |
1411 | 1399 | ||
1412 | envp[i] = NULL; | ||
1413 | return 0; | 1400 | return 0; |
1414 | } | 1401 | } |
1415 | 1402 | ||
1416 | #else | 1403 | #else |
1417 | 1404 | ||
1418 | static int usb_if_uevent(struct device *dev, char **envp, | 1405 | static int usb_if_uevent(struct device *dev, struct kobj_uevent_env *env) |
1419 | int num_envp, char *buffer, int buffer_size) | ||
1420 | { | 1406 | { |
1421 | return -ENODEV; | 1407 | return -ENODEV; |
1422 | } | 1408 | } |