Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267926
b: refs/heads/master
c: 0ddda66
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 25, 2011
1 parent 46d94d1 commit 60ed3bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 47 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5cee7cb79d210f48c19692a79e0508ec001e439f
refs/heads/master: 0ddda6603a6eea0b3aff294648ecb30a22e974f1
56 changes: 10 additions & 46 deletions trunk/drivers/staging/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,58 +237,22 @@ static struct device_attribute vmbus_device_attrs[] = {
* This routine is invoked when a device is added or removed on the vmbus to
* generate a uevent to udev in the userspace. The udev will then look at its
* rule and the uevent generated here to load the appropriate driver
*
* The alias string will be of the form vmbus:guid where guid is the string
* representation of the device guid (each byte of the guid will be
* represented with two hex characters.
*/
static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
{
struct hv_device *dev = device_to_hv_device(device);
int ret;

ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={"
"%02x%02x%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x%02x%02x%02x%02x%02x%02x}",
dev->dev_type.b[3],
dev->dev_type.b[2],
dev->dev_type.b[1],
dev->dev_type.b[0],
dev->dev_type.b[5],
dev->dev_type.b[4],
dev->dev_type.b[7],
dev->dev_type.b[6],
dev->dev_type.b[8],
dev->dev_type.b[9],
dev->dev_type.b[10],
dev->dev_type.b[11],
dev->dev_type.b[12],
dev->dev_type.b[13],
dev->dev_type.b[14],
dev->dev_type.b[15]);

if (ret)
return ret;
int i, ret;
char alias_name[((sizeof((struct hv_vmbus_device_id *)0)->guid) + 1) * 2];

ret = add_uevent_var(env, "VMBUS_DEVICE_DEVICE_GUID={"
"%02x%02x%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x%02x%02x%02x%02x%02x%02x}",
dev->dev_instance.b[3],
dev->dev_instance.b[2],
dev->dev_instance.b[1],
dev->dev_instance.b[0],
dev->dev_instance.b[5],
dev->dev_instance.b[4],
dev->dev_instance.b[7],
dev->dev_instance.b[6],
dev->dev_instance.b[8],
dev->dev_instance.b[9],
dev->dev_instance.b[10],
dev->dev_instance.b[11],
dev->dev_instance.b[12],
dev->dev_instance.b[13],
dev->dev_instance.b[14],
dev->dev_instance.b[15]);
if (ret)
return ret;
for (i = 0; i < ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2); i += 2)
sprintf(&alias_name[i], "%02x", dev->dev_type.b[i/2]);

return 0;
ret = add_uevent_var(env, "MODALIAS=vmbus:%s", alias_name);
return ret;
}


Expand Down

0 comments on commit 60ed3bd

Please sign in to comment.